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

CFFILE MIME error

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

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.
Translate
Community Expert ,
May 11, 2006 May 11, 2006
I immediately thought of

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

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
Community Beginner ,
May 11, 2006 May 11, 2006
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.
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
Participant ,
May 12, 2006 May 12, 2006
I had to do the same - I built a script to check the extensions and filtered this way..

Jam
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
Engaged ,
May 12, 2006 May 12, 2006
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.
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
Community Beginner ,
May 12, 2006 May 12, 2006
LATEST
Thanks for your help guys/girls? As I mentioned in my second post, I have changed the way i limit file using extensions.
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