The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Dropbox Photo Sideloader
error when sideloading (8 posts)

  1. abacus718
    Posted 3 years ago #

    Sideloading /WE Bike Web Photos/WE Party-Michelle/P1070406_sm.jpg ... Error when sideloading.
    File is empty. Please upload something more substantial. This error could also be caused by uploads being disabled in your php.ini.

    file uploads are ON in php.ini


  2. Morgan Kay
    Posted 3 years ago #

    I ran into this problem as well, and for me it was a problem with having spaces in the URL I was trying to get (it looks like you probably have the same problem).
    There is an open ticket about this:

    As a desperate quick fix, I wound up changing my wp-admin/includes/file.php to change spaces into "%20"s -- though changing core files is a really bad idea! (I needed a solution Right Now, and I will be keeping track of the changes, as well as the ticket to see if it gets resolved.)

  3. Innomen
    Posted 2 years ago #

    This also happens if the dropbox folder you are sideloading from has spaces.

    "To Sideload" failed as above.

    "ToSideload" did not.

  4. jpw94
    Posted 2 years ago #

    It seems like it's NOT getting solved at this point.
    Morgan, you made a change to the file.php which changed spaces to "%20".
    Where, and how, would that be made exactly?

    Thanks in advance.

  5. loringllc
    Posted 2 years ago #

    Try this it works just fine, around line 214 in file dropbox-photo-sideloader.php in wp-content/plugins/dropbox-photo-sideloader


    $result = media_sideload_image(urldecode($tempurl['url']), $post_id);


    $result = media_sideload_image(urldecode(rawurlencode($tempurl['url'])), $post_id);

    I also added:

    $file = rawurlencode($file);
    			echo "
    <li>Sideloading {$file} ... ";
    just for an intelligent check
    works current wp version as of this post.
    Merry Christmas</li>
  6. loringllc
    Posted 2 years ago #

    oops ! forgot one little wrinkle - if you don't change this line your file will have the %20 where the spaces where in file name saved on the server. so do this -
    $file_array['name'] = basename($matches[0]);

    $file_array['name'] = preg_replace('/\s|%20/', '-', basename($matches[0]));
    in file
    ok its a core file but it works your file gets uploaded and gets saved as something you can use.

    You would think sideload function would sanitize the file names - oh well!

  7. loringllc
    Posted 2 years ago #

    Seems the issue is really a WP core problem with media_sideload_image(). preg_replace() between "\" and "." from right to left. before calling media_sideload_image(). That would have been my next thought. But then I could have my head in a dark place. :-)

  8. Dirty Bill
    Posted 2 years ago #

    Not RegeX familiar enough to contribute, but isn't there a filter for directly exchanging these codes for their ascii equiv? Ge gentle.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Dropbox Photo Sideloader
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic