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

CFFILE MIME error

Community Beginner ,
May 10, 2006 May 10, 2006

Copy link to clipboard

Copied

I am using the code attached to upload a file, it should only accept gif or tiff files. When i upload a tiff file, cffile reports the file as image/jpeg instead of image/tiff. I have tried using several different files with different tiff compression types etc and no luck.
TOPICS
Advanced techniques

Views

494

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

correct answers 1 Correct answer

Community Beginner , May 12, 2006 May 12, 2006
Thanks for your help guys/girls? As I mentioned in my second post, I have changed the way i limit file using extensions.

Votes

Translate

Translate
Community Expert ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

I immediately thought of

cfif isDefined("form.company_logo_file") and form.company_logo_file neq "">
<cfset request.accept = "image/*">
...etc.
</cfif>

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
Community Beginner ,
May 11, 2006 May 11, 2006

Copy link to clipboard

Copied

Unfortunately that doesn't help when trying to limit users to only GIF's and TIFF's and not JPG's, BMP's etc.

I have found out that it is actually a problem with internet explorer. When i submit a file upload in FF it shows the correct MIME type. In IE it comes through as the incorrect one or octet/stream.

I have had to change my code to test on file extension instead.

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
Participant ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

I had to do the same - I built a script to check the extensions and filtered this way..

Jam

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
Engaged ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

I would not have it look at the mime type, but have it look at the actual extension. If it doesnt match the ext, delete it.

You could put the extensions in a list, or array, and have it check it to see if it is in the list or array, and if not, nuke it.

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
Community Beginner ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

LATEST
Thanks for your help guys/girls? As I mentioned in my second post, I have changed the way i limit file using extensions.

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