Answered
cffile:upload - accept - problem
Greetings,
My desire is to restrict file uploads to .doc / .pdf / .xls documents.
All seems to be working fine when I upload either .doc or .pdf documents.
However, when I attempt a .xls upload, I get the error message displayed in
my code section <cfcatch></cfcatch> below . I understand what the error
message is indicating, but do not understand why.
I have tried both application/msexcel - and - application/ms-excel and have
received the same error. So perhaps I have the wrong syntax for the excel
component.
Does someone know the correct syntax to use for the excel component?
Is there something else I need to be doing regarding excel files?
Also does someone have a work around for the new microsoft extensions?
Example: docx, xlsx
Thanks in advance for insight to this.
Leonard
- - - My code below - - -
<cftry>
<cffile
action="upload"
destination="C:\path\to\the\folder"
filefield="upload_doc"
nameconflict="overwrite"
accept="application/msword, application/pdf, application/ms-excel">
<cfcatch type="application">
Type - Application
Message - The MIME type of the uploaded file application/vnd.ms-excel was not accepted by the server.
Detail - Only files of type application/msword, application/pdf, application/ms-excel can be uploaded.
Verify that you are uploading a file of the appropriate type.
</cfcatch>
</cftry>
