Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

MIME Type Check for file upload

New Here ,
Jul 19, 2007 Jul 19, 2007
Hello!

I'm working on a multi-file upload application for a client. I need to check file size and file MIME type as part of the validation process.

File size check...easy...that's working fine.

File MIME type, it seemed to be working properly in Firefox but not in Internet Explorer.

I cannot seem to figure out the best cross-browser method to validate MIME type for files being uploaded.

I am using CFFILE to upload the files to a temp directory first. I do have the "accept" attribute currently set and am using a <cfcatch type="application"> around the validation code.

Are there any dependable cross-browser methods (built-in tag or function, custom tag, cfscript, etc) to check file MIME type for files being uploaded through an upload form?

Thank you for any assistance that can be provided!

Best,
Tony, Freelance Web Developer
TOPICS
Advanced techniques
447
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 19, 2007 Jul 19, 2007
You could try using listlast() on the file name.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 20, 2007 Jul 20, 2007
LATEST
ListLast() would help me check the file extension but not the MIME type. I'm trying to make this as secure as I can, if possible.

Thanks,
Tony
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources