Last modified: 2014-05-16 21:13:18 UTC
Uploading is dwg files is fine. $wgFileExtensions = array( 'dwg', 'jpg', 'png', 'gif', 'jpeg', 'pdf', 'txt' ); But moving is impossible. File:Test 1.dwg >> File:Test 2.dwg = "The new file extension does not match its type". Tried adding variations of following to mime.info & mime.types with no luck: image/vnd.dwg image/x-dwg application/acad [DRAWING] Image table for all .dwg files has the following field values: img_media_type = UNKNOWN img_major_mime = unknown img_minor_mime = unknown Not sure this is even considered a bug.
removing keyword need-review, since this doesn't need review (there's no patch or anything else to review). Not sure if easy is appropriate either, but leaving that be as I'm not sure what the criteria for "easy" actually is. >Not sure this is even considered a bug. I'd imagine this is a bug, as if you were able to get past the mime type checks at upload, you should also be able to when moving the file.
I also have this problem with MP3 files in 1.16.0.
My config is: $wgCheckFileExtensions = true; $wgStrictFileExtensions = true; $wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'wav', 'mp3', 'pdf' ); And I am moving from "File:Daily Inspirations 1010-12-9.mp3" to "File:Daily Inspirations 1010-12-9.mp3". I do have Admin access.
Added mp3 move-bug reference link.
Fixed by doing this: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66069
Perhaps there is a similar subtle/random fix for subject .dwg files?
Here's a workaround... Added this line to mime.info: application/acad application/x-acad application/autocad_dwg image/x-dwg application/dwg application/x-dwg application/x-autocad image/vnd.dwg drawing/dwg [DRAWING] And added this line to mime.types: application/acad dwg This seems to assign a valid mime type to dwg files on upload and allows them to be moved thereafter. Still, why it doesn't allow moving while being an unknown type is beyond me. I'd rather have just left it alone. Will have to manually fix my image table to compensate for old files I suppose.
I could add a new config option to enable moving of unknown files, or I could just do that unconditionally. Does anybody have anything against the latter option?
Thinking about it, this should follow the same configuration options as regular uploading, so $wgCheckFileExtensions and $wgStrictFileExtensions.
I had tried different combinations of settings of $wgCheckFileExtensions and $wgStrictFileExtensions (before finally re-doing the mime info). Still had the same problem (moving unknown file types). Not sure if anyone else could verify that.
Bryan, I like the idea you mentioned on r66069 better: make the mime checks check for non-canonical types as well as canonical types.
(In reply to comment #11) > Bryan, I like the idea you mentioned on r66069 better: make the mime checks > check for non-canonical types as well as canonical types. I'm not sure if that would fix the dwg issue, as there is no entry for dwg in mime.info
r82418 -- added mime.info information
I am not sure if I should open an new bug report. I wanted to move an .eml file but get "The new file extension does not match its type" as an error message. (MW 1.16.2)
I'm curious if this is still a problem?
Hmm ..., just tryied to check at least for eml-files. However even though I set $wgVerifyMimeType = false; and added "eml" to the array of $wgFileExtensions it is not possible to upload eml-files on MW 1.23-rc.1. Will have to check this tomorrow. Either I misunderstood something which is possible or it is a bug. I will report another nasty bug reappearing which is there for over a year now. To cut it short: It's obviously already to late today.