Title: Error when saving
Last modified: October 8, 2017

---

# Error when saving

 *  Resolved [patsam](https://wordpress.org/support/users/patsam/)
 * (@patsam)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-when-saving-6/)
 * Hi,
    When I click Save I get this error
 * > Sorry, could not insert attachment into media library. WP error:
   >  File is empty.
   > Please upload something more substantial.
 * I am using latest version 1.1.3
 * I am also using an aws s3 bucket and the S3-Uploads-master plugin by human made
 * I can upload media without any problems normally its only when using drawit do
   I get this error
 * My error log shows this
 * PHP message: PHP 2. do_action($tag = *uninitialized*, $arg = *uninitialized*)/
   var/www/mysite.com/htdocs/wp-admin/admin-ajax.php:91
    PHP message: PHP 3. WP_Hook-
   >do_action($args = *uninitialized*) /var/www/mysite.com/htdocs/wp-includes/plugin.
   php:453 PHP message: PHP 4. WP_Hook->apply_filters($value = *uninitialized*, 
   $args = *uninitialized*) /var/www/mysite.com/htdocs/wp-includes/class-wp-hook.
   php:323 PHP message: PHP 5. drawit->sideload_handler(*uninitialized*) /var/www/
   mysite.com/htdocs/wp-includes/class-wp-hook.php:298 PHP message: PHP 6. media_handle_sideload(
   $file_array = *uninitialized*, $post_id = *uninitialized*, $desc = *uninitialized*,
   $post_data = *uninitialized*) /var/www/mysite.com/htdocs/wp-content/plugins/drawit/
   drawit.php:321 PHP message: PHP 7. wp_handle_sideload($file = *uninitialized*,
   $overrides = *uninitialized*, $time = *uninitialized*) /var/www/mysite.com/htdocs/
   wp-admin/includes/media.php:410 PHP message: PHP 8. _wp_handle_upload($file =*
   uninitialized*, $overrides = *uninitialized*, $time = *uninitialized*, $action
   = *uninitialized*) /var/www/mysite.com/htdocs/wp-admin/includes/file.php:478 
   PHP message: PHP 9. apply_filters($tag = *uninitialized*, $value = *uninitialized*)/
   var/www/mysite.com/htdocs/wp-admin/includes/file.php:264 PHP message: PHP 10.
   WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) /var/
   www/mysite.com/htdocs/wp-includes/plugin.php:203 PHP message: PHP 11. S3_Uploads-
   >filter_sideload_move_temp_file_to_s3($file = *uninitialized*) /var/www/mysite.
   com/htdocs/wp-includes/class-wp-ho
 * Any ideas?
 * Thanks in advance
 * BTW Thanks for your work on this, it’s great

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

 *  Thread Starter [patsam](https://wordpress.org/support/users/patsam/)
 * (@patsam)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-when-saving-6/#post-9571691)
 * Solved
 * Just found out the reason and its to do with the plugin **s3_uploads_master**
   which is a plugin to connect your media to an amazon s3 bucket.
 * The issue is to do with a call to “filter_sideload_move_temp_file_to_s3()” in
   this plugin which is triggered by the filter “wp_handle_sideload” (called within
   drawit) .
 * Apparently this is no longer needed and the latest version has or will have this
   removed.
 * In the meantime I just returned the file unchanged
 *     ```
       public function filter_sideload_move_temp_file_to_s3( array $file ) {
   
               return $file; // get out with out changing anything
   
               // it seems this function is not needed since 4.4 in fact it causes an issue with drawit plugin
   
       		$upload_dir = wp_upload_dir();
       		$new_path   = $upload_dir['basedir'] . '/tmp/' . basename( $file['tmp_name'] );
   
       		if(is_super_admin()){
       		    echo '<PRE>'.$file['tmp_name'].'- NEW PATH='.$new_path.'</PRE>';
               }
   
       		copy( $file['tmp_name'], $new_path );
       		unlink( $file['tmp_name'] );
       		$file['tmp_name'] = $new_path;
   
       		return $file;
       	}
       ```
   
 * Hope this helps anyone else with this issue when using this great plugin
 *  Plugin Author [assortedchips](https://wordpress.org/support/users/assortedchips/)
 * (@assortedchips)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-when-saving-6/#post-9571701)
 * Glad you figured it out (and quickly, I might add)! I’ll also mention that I 
   use the “Amazon Web Services” with “WP Offload S3 Lite” plugins, which also works
   fine with DrawIt. Thanks for providing your solution here!

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

The topic ‘Error when saving’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/drawit_9fd0dc.svg)
 * [DrawIt (draw.io)](https://wordpress.org/plugins/drawit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/drawit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/drawit/)
 * [Active Topics](https://wordpress.org/support/plugin/drawit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/drawit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/drawit/reviews/)

## Tags

 * [Saving](https://wordpress.org/support/topic-tag/saving/)

 * 2 replies
 * 2 participants
 * Last reply from: [assortedchips](https://wordpress.org/support/users/assortedchips/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/error-when-saving-6/#post-9571701)
 * Status: resolved