Delete the original image and then upload the modified version, perhaps? That will let the filename work okay.
But you cannot keep the same attachment ID. Ever. Period. ID’s only increase, they do not get replaced.
Thread Starter
geo316
(@geo316)
but understand that the media library stores the image file in a folder hierarchy by date. If I delete an image and then upload one with the same name a month later its not guaranteed that it will have the same path…
I’ll have to look into the NG gallery’s way of storing files…
Thanks for the reply
Thread Starter
geo316
(@geo316)
…to clarify: if I upload an image and then a month later delete it and upload a new file with the same name the path will likely be different…
Well… you could turn off the month/year thing on the Settings->Miscellaneous screen.
Thread Starter
geo316
(@geo316)
…that actually works for me – 🙂
This may help someone else – I’m uploading an image via media library and using it as a static image in the site. I get the URL to the file once it’s uploaded and hard code it into the site HTML.
Using the media library I can now change that image by deleting it and then uploading a replacement file with the same name. The task stays within WordPress – no FTP’ing!
a quick gripe if I may – why can’t there be an upload link right on the Media Library page? You can view and delete an image there but you have to go all the way over to create -> post and use the add media buttons above the tiny mce bar to upload…
Anyway – thanks Otto42 for helping me to think through this…
why can’t there be an upload link right on the Media Library page?
WordPress ties all attachments to specific posts. So when you upload something, it creates an entry for it pointing to its parent post. This allows things like the gallery feature to work.
Hey,
I gotta agree – my first encounter with the media library caused a severe headscratching for me – I looked for that “Upload New File” button in the edit area. I think this is a must have in the wishlist.