Skip to main content
Inspiring
August 5, 2011
Question

CFFILE Upload - Accept

  • August 5, 2011
  • 2 replies
  • 1258 views

From Adobe's help page about CFfile Upload and the accept attribute...

Limits the MIME types to accept. Comma-delimited list. For example, the following code permits JPEG and Microsoft Word file uploads:

accept="image/jpg, application/msword"

The browser uses the file extension to determine file type.

  • Then why can't I list acceptable file extensions instead of trying to figure out all of the mime types for a particular file?
  • Is there a downside to using extensions vs mime types?

Thanks

    This topic has been closed for replies.

    2 replies

    Inspiring
    August 5, 2011

    File extensions are just a Windows thing.  Other operating systems don't use the file extension (if a file has one) to identify the file type.  That's probably why Adobe went a more generic route.

    But the docs seem to be making a connection between a file upload and the CFFILE tag.  CFFILE doesn't have anything to do with uploading a file from a browser... that's between the client browser and the web server.  All CFFILE does is copy the uploaded file from the temporary upload dir to [wherever you want it].  the "upload" action of CFFILE is quite poorly named, I think

    --

    Adam

    Inspiring
    August 5, 2011

    the "upload" action of CFFILE is

    quite poorly named, I think

    Yep. Very misleading.

    Inspiring
    August 5, 2011
    • Then why can't I list acceptable file extensions instead

    of trying to figure out all of the mime types for a

    particular file?

    Because the tag does not implement such a feature?

    • Is there a downside to using extensions vs mime types?

    Mime types are easily spoof-able. So checking the extension, in combination with other measures, is actually safer.

    http://www.petefreitag.com/item/701.cfm

    jbreslowAuthor
    Inspiring
    August 5, 2011

    Thanks that link helps.

    Inspiring
    August 5, 2011

    BTW: If you feel strongly about a missing feature, submit it. I believe the bug database accepts both.

    http://cfbugs.adobe.com/