admin管理员组文章数量:1414604
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.
本文标签: xmlimport svgfiles from wxr(upload worksimport not)
版权声明:本文标题:xml - import svg-files from wxr - (upload works, import not) 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745161097a2645443.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论