Microsoft Word Templates (.dot) become 4-byte files when trying to view or download

Description

After uploading a Microsoft Word Template (.dot) in the File Media Library, while it uploads with no errors (as the MIME type is application/msword) and appears fine on the server under the www\files\dmfile path, when trying to view or save the file, it opens as a 4-byte raw file.

However, Microsoft Word Documents (.doc) also upload correctly, but have no such problems when viewing them.

Environment

IIS 6.0, Windows Server 2003, ColdFusion MX 7, MS SQL Server 2005

Activity

Frederic Altorfer 
February 3, 2011 at 5:42 AM

Could reproduce this problem on CF8. CF9 was fine.
Anyway... fixed invalid mimetypes when downloading files.

Geoff Bowers 
March 19, 2008 at 11:11 PM

Please confirm with Mat that he's happy with the suggested change. There's been some recent improvements to addressing mime-type that may be applicable here.

John Tsouvallas 
March 4, 2008 at 3:52 AM

A workaround for this issue is to drop the mimeType variable and let ColdFusion handle the MIME types.

The following changes are to be made to "core/tags/farcry/download.cfm":

Comment out line 102: <cfset mimeType=getPageContext().getServletContext().getMimeType(filePath) />

Comment out type="#mimeType" from line 139: <cfcontent type="#mimeType#" file="#filepath#" deletefile="No" reset="Yes" />

Fixed

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged3h remaining

Components

Fix versions

Priority

Created February 22, 2008 at 3:46 AM
Updated February 3, 2011 at 5:42 AM
Resolved February 3, 2011 at 5:42 AM