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

Uploading files using CFFILE

Explorer ,
Aug 31, 2007 Aug 31, 2007

Copy link to clipboard

Copied

Is there a way to validate the mime type a file that is being uploaded using CFINPUT type="FILE" prior to the user hitting the submit button?
TOPICS
Advanced techniques

Views

331

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 ,
Sep 02, 2007 Sep 02, 2007

Copy link to clipboard

Copied

You can't do it with cf code only. You have to write some javascript and call it on the input's onBlur or onChange event.

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
Contributor ,
Sep 02, 2007 Sep 02, 2007

Copy link to clipboard

Copied

LATEST
The long answer or longer answer is that CF can't tell you what it is until it gets to the server. Don't forget (it's easy to do) that CF is SERVER side. That is why you will need some Javascript to verify what the file type is before it is submitted.

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