Hi,
I have the same issue “Failed to import (Media)”.
The strange thing is that some images are imported and “smaller image” failed to import.
I’m php developer so I didn’t hasitate and I dived into the code. I noticed this several lines that prevents smaller images to be imported.
file: vendor/proteusthemes/wp-content-importer-v2/src/WXRImporter.php
if ( isset( $headers['content-length'] ) && $filesize !== (int) $headers['content-length'] ) {
unlink( $upload['file'] );
return new \WP_Error( 'import_file_error', __( 'Remote file is incorrect size', 'wordpress-importer' ) );
}
If I remove this check all images are imported. Also I found following article about this issue. (https://www.playnicetogether.com/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/)
Proposed solution does not work with the latest version of WP.
Do you have any suggestion how to fix this without touching plugin’s code?
Thanks in advance.
Cheers,
Milos
-
This reply was modified 7 years, 8 months ago by docodes.