tracker issue : CF-3852726

select a category, or use search below
(searches all categories and all time range)
Title:

<cffile> incorrectly recongising MIME type of Microsoft Excel documents as Microsoft Word Documents

| View in Tracker

Status/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:

  1. January 28, 2015 00:00:00: 1_bug3852726.zip

Comments:

The same underlying problem exists in fileGetMimeType as well
Comment by External U.
10057 | November 17, 2014 06:39:54 AM GMT
On CF10 with latest update, the Mime type for excel document is recognised properly as "application/vnd.ms-excel". Please try with latest update and let us know about this. Thanks.
Comment by Akhila K.
10058 | November 26, 2014 01:21:16 AM GMT
Please let us know about this issue if you are still facing it. Thanks.
Comment by Akhila K.
10059 | December 03, 2014 12:16:26 AM GMT
We are closing this bug since its fixed in update. Incase if user is still facing the issue, please let us know. We will look into it.Thanks.
Comment by Akhila K.
10060 | December 03, 2014 04:50:58 AM GMT
We are running CF10 with update 15 and this is still happening using the code above, please re-open this bug
Comment by External U.
10061 | January 13, 2015 08:28:14 AM GMT
Sorry was logged in using the wrong account... Please re-open this bug the problem still exists in CF10 update 15
Comment by External U.
10062 | January 13, 2015 08:32:47 AM GMT
We are still unable to repro this case. Please provide us the file that is causing this issue. Thanks.
Comment by Akhila K.
10063 | January 22, 2015 10:15:46 AM GMT
OK attached is an xls file that is being reported as EXTENSION: doc; MIMETYPE: application/vnd.msword; TYPENAME: Microsoft Office Word 97-2003 Document Please do not use this file for any purpose apart from testing - although I have removed any personal info, it still contains some private data.
Comment by External U.
10064 | January 27, 2015 11:30:01 AM GMT
Please delete the attached file...
Comment by External U.
10065 | January 27, 2015 11:34:50 AM GMT
I am currently seeing this exact issue and using the most current and updated ColdFusion 10. What is a solution that will work?
Comment by External U.
10066 | November 19, 2015 05:08:24 PM GMT