Upload works - Import from wxr not
We're updating several sites with a new page, imported from a wxr file. Page, included form, jpg, png - all work fine but SVG not so much.
I've checked scripts that add svg to allowed mime, ($mimes['svg'] = 'image/svg+xml';$mimes['svg'] = 'image/svg';
etc)
I've testet plugins (safeSvg, Disable Real MIME Check)
I've even added define( 'ALLOW_UNFILTERED_UPLOADS', true );
into wp-config!
Same result - every time: "unable to import."
But regular upload works.
Any Ideas how to solve this?
Upload works - Import from wxr not
We're updating several sites with a new page, imported from a wxr file. Page, included form, jpg, png - all work fine but SVG not so much.
I've checked scripts that add svg to allowed mime, ($mimes['svg'] = 'image/svg+xml';$mimes['svg'] = 'image/svg';
etc)
I've testet plugins (safeSvg, Disable Real MIME Check)
I've even added define( 'ALLOW_UNFILTERED_UPLOADS', true );
into wp-config!
Same result - every time: "unable to import."
But regular upload works.
Any Ideas how to solve this?
Share Improve this question edited Sep 12, 2019 at 8:39 Matthew Brown aka Lord Matt 1,0683 gold badges13 silver badges34 bronze badges asked Sep 12, 2019 at 7:59 Leif S.Leif S. 232 bronze badges 1- Hi Leif S., welcome to WordPress Development. Your question may need editing to get the best answers. As a quick guide, pretend you are talking to a busy colleague and have to tell them everything they absolutely need to give you a clear answer before they rush away. Check our guide to asking good questions if you need to. – Matthew Brown aka Lord Matt Commented Sep 12, 2019 at 8:13
1 Answer
Reset to default 0Found my solution after a little more digging.
The problem lies in wordpress-importer
Found this from jan 30 on github:
https://github/WordPress/wordpress-importer/issues/47?_pjax=%23js-repo-pjax-container
Then later the solution here:
https://www.playnicetogether/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/
"the WordPress Importer plugin is not compatible with remote servers that use HTTP compression."
For WordPress v4.6 and above, please use the following:
add_filter( 'http_request_args', function( $r, $url ) { $r['headers']['Accept-Encoding'] = 'identity'; return $r; }, 10, 2 );
This solved the upload issue, and the plugin "SafeSvg" made the svg's show up in the media library.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745161097a4614393.html
评论列表(0条)