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

MIME Type Check for file upload

New Here ,
Jul 19, 2007 Jul 19, 2007

Copy link to clipboard

Copied

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

Views

340

Translate

Translate

Report

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

Copy link to clipboard

Copied

You could try using listlast() on the file name.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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
Documentation