Title: error when sideloading
Last modified: August 21, 2016

---

# error when sideloading

 *  [abacus718](https://wordpress.org/support/users/abacus718/)
 * (@abacus718)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/error-when-sideloading/)
 * 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
 * [http://wordpress.org/extend/plugins/dropbox-photo-sideloader/](http://wordpress.org/extend/plugins/dropbox-photo-sideloader/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Morgan Kay](https://wordpress.org/support/users/gwendydd/)
 * (@gwendydd)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834059)
 * 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: [https://core.trac.wordpress.org/ticket/16330](https://core.trac.wordpress.org/ticket/16330)
 * 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.)
 *  [Innomen](https://wordpress.org/support/users/innomen/)
 * (@innomen)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834123)
 * This also happens if the dropbox folder you are sideloading from has spaces.
 * “To Sideload” failed as above.
 * “ToSideload” did not.
 *  [jpw94](https://wordpress.org/support/users/jpw94/)
 * (@jpw94)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834131)
 * 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.
 *  [loringllc](https://wordpress.org/support/users/loringllc/)
 * (@loringllc)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834132)
 * Try this it works just fine, around line 214 in file dropbox-photo-sideloader.
   php in wp-content/plugins/dropbox-photo-sideloader
 * replace:
 * $result = media_sideload_image(urldecode($tempurl[‘url’]), $post_id);
 * with:
 *     ```
       $result = media_sideload_image(urldecode(rawurlencode($tempurl['url'])), $post_id);
       ```
   
 * I also added:
 *     ```
       $file = rawurlencode($file);
       above:
       			echo "
       <li>Sideloading {$file} ... ";
       just for an intelligent check
       works current wp version as of this post.
       Merry Christmas</li>
       ```
   
 *  [loringllc](https://wordpress.org/support/users/loringllc/)
 * (@loringllc)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834133)
 * 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–
   
   replace: $file_array[‘name’] = basename($matches[0]);
 * with:
    $file_array[‘name’] = preg_replace(‘/\s|%20/’, ‘-‘, basename($matches[
   0])); in file wp-admin/includes/media.php 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!
 *  [loringllc](https://wordpress.org/support/users/loringllc/)
 * (@loringllc)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834134)
 * 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. 🙂
 *  [Dirty Bill](https://wordpress.org/support/users/dirty-bill/)
 * (@dirty-bill)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834135)
 * Not RegeX familiar enough to contribute, but isn’t there a filter for directly
   exchanging these codes for their ascii equiv? Ge gentle.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘error when sideloading’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/dropbox-photo-sideloader.svg)
 * [Dropbox Photo Sideloader](https://wordpress.org/plugins/dropbox-photo-sideloader/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/dropbox-photo-sideloader/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/dropbox-photo-sideloader/)
 * [Active Topics](https://wordpress.org/support/plugin/dropbox-photo-sideloader/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/dropbox-photo-sideloader/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/dropbox-photo-sideloader/reviews/)

 * 7 replies
 * 6 participants
 * Last reply from: [Dirty Bill](https://wordpress.org/support/users/dirty-bill/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/error-when-sideloading/#post-3834135)
 * Status: not resolved