ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Multiple mime types for certain files/uploads?

January 07, 2010 3:40am

Subscribe [3]
  • #1 / Jan 07, 2010 3:40am

    Timo Häkkinen

    25 posts

    Having a problem with a client site. They have a contact form with an attachment. People were having problem with .dwg files. XSS filtering isn’t on, but the files were still blocked due to the mime type not being allowed. Digging into this I found out there are at least 9 different possible mime types for dwg files.

    Questions is, how do I add more than one mime type for a single file type in system/lib/mimes.php?

    I don’t know how this file is processed, but I’d assume it being a simple array that the value has to match the key: “filetype” => “mime type”. I added application/dwg for now and we’re still testing it, but unfortunately we don’t know every program the users might use, so what if we need to allow more than one mime type for one file type?

  • #2 / Jan 07, 2010 3:59am

    John Henry Donovan

    12339 posts

    Timo,

    Good question. Lots of the file types have multiple types. Just adding one type should cover you I believe. The one I would pick is

    'dwg'    =>    'application/dwg'

    Can you confirm if adding unblocks it for you?

  • #3 / Jan 07, 2010 4:23am

    Timo Häkkinen

    25 posts

    John,

    That’s the one I added and our test file made in Illustrator went through just fine. We’re currently working on this with our client, trying dwg files made in AutoCAD and other programs as well as using test files from the end users. I’ll let you know whether we run into problems or if application/dwg seems to work for everything. Thanks! 😊

  • #4 / Jan 07, 2010 7:06am

    Ingmar

    29245 posts

    Sounds good. Let us know how it goes.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases