Best content-type and extension for web delivered Excel 2003 SpreadsheetML file - content-type

I am working with an API that has a report URL call. The report has an "Excel 2003 XML" format option. When that is selected they deliver it as:
Content-Type: application/vnd.ms-excel
content-disposition: inline; filename="report-name.xls"
OpenOffice.org up to 3.0 tries to bring this in as a text import and I'm concerned that Office 2007 might give users the extension mismatch warning. This shouldn't be our problem but people like to shoot the messenger so I am researching and looking for suggestions to give the API developers about file name extensions.
I can rename the file to .xlsx or .xml and OOo happly opens the file into Calc, but the file isn't really an .xlsx file, .xml is annoyingly generic and I don't know what Office 2007 will think of those options.
What is the best content-type and extension for web delivered Excel 2003 (11) SpreadsheetML files to avoid these and other issues?

application/vnd.ms-excel works fine, just change your file extension in filename parameter to be an standar excell extension (xls)

Related

xls file unknown file format in IE8

I have develop a report and export as excel file. When download that excel file it can not open in microsoft excel. it shows unknown file format. When export in pdf it open in adobe reader directly. Why the excel file not open directly.
Use Fiddler or the IE developer tools to examine the Content-Type header of the HTTP response. It should be: `Content-Type: application/vnd.ms-excel' (see here).
Also, look for a header like Content-Disposition: attachment; filename=foo.xls. If no such header is present, consider adding one.
I solved using
open windows explorer->Tools->Folder Option-> select "File Types" tab -> click on "New" button and Click on "Advanced" button provide the extension and choose Microsoft Office excel application ->OK(twice)
That's it.

Uploading JSON File as Multimedia Component in SDL Tridion 2011

I am trying to upload JSON files in Tridion and publish them. I have created a new multimedia type for JSON files with MIME Type : application/json
I have then uploaded the file as multimedia component and published the file. I can see the file created at the delivery server, but when I try to read the file from the URL, it shows File Not Found.
I am using ASP.NET application at Delivery Server with IIS 7.5
Do I need to do some other configuration? Please Help.
Thanks & Regards
Sharad Kumar Sangal
You will need to add your file extension and mime type to IIS. If you need help doing so check out this link:
http://www.iis.net/configreference/system.webserver/staticcontent/mimemap
The actual values you need are probably .json for the file name extension and application/json for the MIME type.

What to set as mimetype for CSV files to open in spreadsheet applications

My application lets users download their data as CSV files. These are supposed to open in spreadsheet applications. On a Linux system, I get prompted correctly to open with OpenOffice, but some of my users complain that when they download the file, it does not open automatically Excel, but asks them to choose the application. When they download a CSV from some other site, it opens correctly in Excel.
I am setting:
mimetype: text/csv
content_disposition: attachment; filename.csv
Try this:
Content-Type: text/csv; name="filename.csv"
Content-Disposition: attachment; filename="filename.csv"
In Windows browsers the MIME type is ignored after the file is downloaded and only file name extension is used to determine the corresponding application.
Also, making .CSV file open in Excel correctly is hard, because the default separator is taken from Regional settings on the machine on which the CSV is opened. Furthermore, the encoding is not determined from the file content or MIME type, so any non-ASCII characters are hard to get working.
You can define the separator in first line of your CSV file using sep so that it appears as follows:
sep=;
See also #FilipNavara's answer.

File extension problems with classic ASP

I am running a classic ASP website where my online users can attach files to the internal message system. But whenever they upload an attachment with more then 3 characters in the file extension, the server gives me a 404.
Files like mypicture.jpg works fine, but files like mydocument.docx doesn't work?
Any suggestions?
IIS6 will only serve documents where the file extension is mapped to a mime type in the mime map property for the server or the site. In order to serve the more recent Office 2007 document types you will need to add extra mappings.
There are a number of places where you can find a list of these new mime types.
This is a simple one; from Office 2007 mime types for IIS:
.docm,application/vnd.ms-word.document.macroEnabled.12
.docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotm,application/vnd.ms-word.template.macroEnabled.12
.dotx,application/vnd.openxmlformats-officedocument.wordprocessingml.template
.potm,application/vnd.ms-powerpoint.template.macroEnabled.12
.potx,application/vnd.openxmlformats-officedocument.presentationml.template
.ppam,application/vnd.ms-powerpoint.addin.macroEnabled.12
.ppsm,application/vnd.ms-powerpoint.slideshow.macroEnabled.12
.ppsx,application/vnd.openxmlformats-officedocument.presentationml.slideshow
.pptm,application/vnd.ms-powerpoint.presentation.macroEnabled.12
.pptx,application/vnd.openxmlformats-officedocument.presentationml.presentation
.xlam,application/vnd.ms-excel.addin.macroEnabled.12
.xlsb,application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsm,application/vnd.ms-excel.sheet.macroEnabled.12
.xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltm,application/vnd.ms-excel.template.macroEnabled.12
.xltx,application/vnd.openxmlformats-officedocument.spreadsheetml.template
Adding all mime-types to IIS in one step is very simple:
The easiest way to do this is stopping IIS and editing the metabase
XML file (C:\WINDOWS\system32\inetsrv\MetaBase.xml) using a text
editor. Search for the <IIsMimeMap Location="/LM/MimeMap" /> element
and append the lines above to the MimeMap attribute
The server probably has no mime-type defined for docx and such file extensions.

Why is FileInfo showing an extra file extension?

I have been having problems with creating a download list of files for a downloader and was getting unexplained "File Does Not Exist" returns. My .avi files were returning found but but .exe and .txt files were getting the not exists.
I have now found by pulling in the whole directory and examining the file contents that my .exe files are showing ".exe.exe". My .txt files are showing ".txt.rtf". Wow, browsing the file directory in Server 2008 only shows a single extension. I don't see an option to display the extension as a column, just the "type". My directory looks like this:
Name Type
File1.exe Application
File2.txt Rich Text Document
File3.avi AVI File
I had renamed some of these files, maybe I just cannot rename files. I will try using originals ans see if I am ok. Maybe I need to rename the offending files without the displayed extensions. Is this just something weird with the server browser?
Thanks,
James
Have you checked that "Tools > Folder Options > View > Hide extensions for known file types" is unchecked?
The option should be in (more or less) the same place on Windows Server 2008, I'm answering from home so I only have XP Pro to go on ;)
Obvious I know, but it sometimes is the obvious answer that we overlook.
Just to add - there's no option to show the extension in a separate column.
Windows has a "feature" that hides file extensions for known file types. Always turn that off or you'll find yourself creating problems like this.

Resources