Hello! In arwiki we import files from enwiki but when I try to upload "SVG" by API I get this error:
File extension \".svg\" does not match the detected MIME type of the file (image/png).
Is there any solution?
Thank you.
Hello! In arwiki we import files from enwiki but when I try to upload "SVG" by API I get this error:
File extension \".svg\" does not match the detected MIME type of the file (image/png).
Is there any solution?
Thank you.
Hi,
I've never seen a request like this. I don't think it's a problem with MediaWiki. Can you give us steps to reproduce?
Hi @Zoranzoki21 I wanted to upload this file: [[en:File:Kuwait Petroleum Corporation Logo.svg]] by API but I get this error:
{"error":{"code":"verification-error","info":"File extension \".svg\" does not match the detected MIME type of the file (image/png).","details":["filetype-mime-mismatch","svg","image/png"],"*":"See https://ar.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1222"}
Closing as invalid because there is no bug.
Please read the error message: File extension \".svg\" does not match the detected MIME type of the file (image/png).
Sorry for my previous comment, not sure what I did wrong. Full link: https://en.wikipedia.org/wiki/File:Kuwait_Petroleum_Corporation_Logo.svg
$:acko\> file -i Kuwait_Petroleum_Corporation_Logo.svg Kuwait_Petroleum_Corporation_Logo.svg: image/svg+xml; charset=us-ascii
What is possible (steps):
Looks like this is reason for error. And it is expected, because URL is to png file.
Given that the file could be uploaded to Commons, which sends it through the exact same checks, this is probably user error. (Although I guess the mimetype testing code could have changed since it has been uploaded, but it seems very unlikely.)
@Jar: Unfortunately closing this Phabricator task as no further information has been provided. In the future, please follow https://www.mediawiki.org/wiki/How_to_report_a_bug and provide a list of clear steps to reproduce, expected outcome, and actual outcome. Thanks.