Skip navigation
Currently Being Moderated

Mime type Issue docx

Apr 20, 2009 6:37 AM

Unable to upload docx files from systems which does not have ms office 200

 

Code : -
<cffile action="upload"
               filefield="browsefile"
               destination="#variabes.path#"
               nameconflict="makeunique"                        

accept="application/vnd.openxmlformats-officedocument.wordprocessingml .document,              

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
           
Also added mime type "application/vnd.openxmlformats-officedocument.wordprocessingml.docum ent" in IIS

 

Still getting error.

 

Please help?                

 
Replies
  • Currently Being Moderated
    Apr 22, 2009 7:44 AM   in reply to sujeesh lal

    What is the error message you are receiving?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 23, 2009 2:43 PM   in reply to Libby H

    I also would like to see the error message you get, but I'll take a guess as to what the root of the problem is.  I suspect that computers without Office 2007 installed do not associate your expected MIME type with the docx file.  The accept attribute is constraining what MIME types are valid and the value being submitted is not one of these values.  Try removing the accept attribute from the CFFILE tag.  Instead of relying on the MIME type provided by the browser to verify you have a docx file check the uploaded file for the expected file extension.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 28, 2009 5:52 AM   in reply to sujeesh lal

    I suspect that the computers uploading these files do not associate the Office 2007 with the expected MIME types.

     

    You have two options:

    1. If you have access to the end user's PC you can modify the registry to associate the .docx and .xlsx extensions with the MIME types application/vnd.openxmlformats-officedocument.wordprocessingml.docume nt and application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.

    This works for Windows and Internet Explorer.  I'm not sure how you would do this on Linux or Mac.

     

    2. Remove the accept attribute from CFFILE.  To restrict file types check the extension of uploaded files and delete those that are not permitted.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points