Skip to main content
Inspiring
October 10, 2013
Question

Mime Type

  • October 10, 2013
  • 1 reply
  • 1482 views

I'm having trouble pinpointing if anything changed with the cffile upload mime type in CF10.  It was working fine in 9, but I'm getting the following error when uploading a jpg file type in CF10.

The MIME type or the Extension of the uploaded file image/jpeg was not accepted by the server.
Error detail - Only files of type image/* can be uploaded.

<cffile

            action="upload"

            filefield="Picture"

            destination="\\#expandpath('/')#CompanyPictures\"

            nameconflict="overwrite"

            accept="image/*">

    This topic has been closed for replies.

    1 reply

    Inspiring
    October 10, 2013

    Ensure that your server has a registered mime type for JPEG (.jpg, .jpe and .jpeg files that is set to image/jpeg).  If your server only has an extension setup for one type and you upload a different, it may not detect it properly.

    Inspiring
    October 10, 2013

    That's what i was leaning toward.  I thought it used to be setup in CF Admin, but I couldn't find it.  Thank you for the tip.

    Inspiring
    October 10, 2013

    To my knowledge, at least for IIS, it will determine the file type before it handles the request off to CF.  We had an issue a while back where our system used JPEG files with a .mug extension, so even though it was a JPEG file, our system kept repeating that it wasn't an acceptable mime type until we popped .mug in as image/jpeg into IIS' mime types, and then everything moved forward.  Hoping the same happens here.