Title:
<cffile> incorrectly recongising MIME type of Microsoft Excel documents as Microsoft Word Documents
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): Alistair Wearring / Alistair Wearring (Alistair Wearring)
Created: 11/17/2014
Components: File Management, CFFile
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Major / Most users will encounter
Locale/System: English / Win All
Vote Count: 0
Problem Description:
<cffile> incorrectly recongises MIME type of Microsoft Excel documents (application/vnd.ms-excel) as Microsoft Word Documents (application/msword)
Steps to Reproduce:
Using the code below, attempt to upload an Excel document (.xls) - error message returned "The MIME type or the Extension of the uploaded file application/msword was not accepted by the server"
<cfif not isDefined("form.file")>
<cfoutput>
<form action="##" method="post" name="test" id="test" enctype="multipart/form-data" class="test">
<fieldset>
<label for="file" class="label_medium">Upload file</label>
<input type="file" name="file" accept="application/vnd.ms-excel">
<input name="submit" type="submit" value="Submit" class="button" />
</fieldset>
<fieldset>
</fieldset>
</form>
</cfoutput>
<cfelse>
<cftry>
<cffile action="upload" filefield="Form.file" destination="#uploadFolder#" nameconflict="makeunique" accept="application/vnd.ms-excel" strict="true" >
<cfif cffile.fileWasSaved is "yes">
<cfoutput>File saved</cfoutput>
<cfdump var="#cffile#">
<cfelse>
<cfoutput>File NOT saved</cfoutput>
<cfdump var="#cffile#">
</cfif>
<cfcatch type="any">
<cfoutput>Error: #cfcatch.message#</cfoutput>
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
</cfif>
Actual Result:
The MIME type or the Extension of the uploaded file application/msword was not accepted by the server
Expected Result:
Document uploaded to specified destination directory
Any Workarounds:
Set <cffile> attribute "Strict" to false, remove "accept" attribute or include application/msword to "accept" attribute
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3852726
External Customer Info:
External Company:
External Customer Name: AliWear
External Customer Email:
External Test Config: My Hardware and Environment details: Win 2012 R2 / SQL 2012 Web / ColdFusion 10
Attachments:
- January 28, 2015 00:00:00: 1_bug3852726.zip
Comments: