WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] how do I replace images without FTP? (8 posts)

  1. geo316
    Member
    Posted 5 years ago #

    I'm building a WP site for a client and just noticed that uploading images into the Media Library or into a NextGen Gallery is easy, but I cant replace the image keeping the same file name and id.

    If I re-upload the same file using either Media Library or NG the file is renamed and uploaded as a unique image. Of course this would be generally desirable, but again I want the ability to replace images without having my client FTP.

    Any suggestions? Modifications? Any known plug ins that will let me do this?

    G

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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.

  3. geo316
    Member
    Posted 5 years ago #

    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

  4. geo316
    Member
    Posted 5 years ago #

    ...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...

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Well... you could turn off the month/year thing on the Settings->Miscellaneous screen.

  6. geo316
    Member
    Posted 5 years ago #

    ...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...

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    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.

  8. SectorSeven
    Member
    Posted 5 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic