Incorrect file size check
-
I’ve had ongoing issues with importing media items using this plugin – turns out that it’s because the plugin is doing an incorrect check on the file size:
if ( isset( $headers['content-length'] ) && $filesize != $headers['content-length'] ) { @unlink( $upload['file'] ); return new WP_Error( 'import_file_error', __('Remote file is incorrect size', 'wordpress-importer') ); }
This is incorrect because the HTTP content-length is not always equal to the file size – especially if you have GZIP enabled on your server.
This has led to issues for me when importing PDF and SVG, both of which are allowed to be sent with GZIP on my server.
- The topic ‘Incorrect file size check’ is closed to new replies.