Rename uploaded file
-
I have had a file (photograph) uploaded a long time, and have seen it on another website. Instead of copying the picture, they are hotlinking to the file I have uploaded.
In order to make them react, I thought I would upload a completely different picture, and let this new file take the same name as the old one had. The picture in my post was easy to change: delete it, and upload the same picture from a file with a different name.
But now I have the problem that I cannot get the new file to have the same name as the old one, even if I have deleted all the files with similar names that I have found. The new file gets a number attatched to the end of it’s name, eg “file1.png”, “file2.png”, “file3.png” and so on depending on how many times I have tried uploading it.
In short, how do I change name (and directory location) of a file I have uploaded?
The blog I need help with is: (visible only to logged in users)
-
-
This is the page in question:
Since writing my previous entry, I have changed this page, so the picture is the same but not the original file name. What i want to achieve is to be able to upliad a new file and have it in the same place as the original file, with the same name.
-
When you upload an image with the same name, it gets the extra numbering to avoid confusion. And the images remain stored long after you delete them from your media library. You might be able to achieve what you want only if you upload the new image weeks after deleting the previous one.
-
Ahhh… Thanks for your answer. I was beginning to tear my hair, wondering why it wouldn’t work. Now I know it’s not something I was doing wrong, which is some sort of comfort.
-
If you have further “scoop” on getting the file replaced, exactly as you wished it, let me know. Maybe time has given you wisdom that I could use.
-
I seem to remember a recent thread here, where thesacredpath said that it took less than weeks to reload an image with the same name. But I can’t find the thread, and I’m not sure how you’d test that the original file was not still stored on wp servers.
-
I don’t know how frequently wordpress “packs” or “compact”s their databases to do the actual delete, but I expect they would do it at least once every 24 hours, and considering the number of blogs here, it may be every 12.
The thing to remember though is that our uploads are stored in a year/month file folder hierarchy which means that unless the new file were uploaded in the same year/month, the URL to the file will be different.
Example:
URL of original file uploaded in May of 2008: http://blogname.wordpress.com/files/2008/05/filename.jpg
URL of new file uploaded in April of 2009: http://blogname.wordpress.com/files/2009/04/filename.jpgSo, unless the file were uploaded in the same year/month, the URL of the image in the post or page would still have to be corrected.
-
Thanks so ever much.
By “the URL of the image in the post or page would still have to be corrected” how would a wp.com person do that? Sometimes, tired, I’m really dense. :-( -
Open the post and then either delete the old image and insert the new one, or go into the HTML tab and correct it.
- The topic ‘Rename uploaded file’ is closed to new replies.