Auto Save Remote Image
[resolved] Doesn't handle % characters correctly (4 posts)

  1. etchedinpixels
    Posted 3 years ago #

    Hi, great idea for a plugin.

    However, I'm having some problems using it with my Smugmug hosted images due to the way it translates % symbols in the URL.

    Here's what happens. I insert an image


    And the plugin uploads it to my site as


    However, WordPress then fails to load the image, it returns a 404.

    I found that the URL needs to be entered as


    Note that in the browser any % in the filename needs to be changed to %25 the plugin isn't doing this when inserting the URL into the post.

    I'm going to see what I can do to fix the code but I barely know anything. I'll post if I have a solution. Thanks for all the great work.


  2. prebhdevsingh
    Plugin Author

    Posted 3 years ago #

    Hi there,

    I will try to fix this bug and update the plugin soon. Thanks for pointing it out.


  3. etchedinpixels
    Posted 3 years ago #


    I don't know much about php but after talking with my developer friend, he suggested the URLDECODE function to convert the image filename before copying it on one's WordPress site.

    It now seems to handle the %3F symbol in my smugmug image correctly.
    It takes the image URL

    and stores the file locally as Giantpeachmoktak-M.jpg

    It would be nice if it also converted the %20 to '_' . But the main thing is that it seemed to handle the question mark (encoded as %3F) correctly.

    I replaced:

    $mirror = wp_upload_bits( str_replace('%20', '', basename( $first_image )), '', wp_remote_retrieve_body( $get ) );


    $mirror = wp_upload_bits( urldecode(basename( $first_image )), '', wp_remote_retrieve_body( $get ) );

    Prebhdev, would you mind telling me if I implemented this correctly and it's working for you too?

  4. prebhdevsingh
    Plugin Author

    Posted 3 years ago #

    Hi there,

    Your friend is correct. I have uploaded new copy of the plugin which fixes this issue. Instead of using urldecode, I'm instead using rawurldecode. This should take care of the problem with % signs in filenames.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Auto Save Remote Image
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.