Eric Wu
Eric Wu

Reputation: 917

ContentType in ASP Classic not creating an excel spreadsheet when running in Chrome

I have an old ASP Classic application running in my company's SaS project. What it does is export a major report in an excel spreadsheet.
The problem is: surprisingly enough, it happens to work perfectly in... IE. All of the versions. Chrome seems to go over the Response.ContentType instruction, and attempts to save the resulting file in a .ASP file format... which goes badly, of course.
Until now, all we've been doing is asking our fellow clients and support attendants to simply change their browsers to an old, unreliable browser (e.g. IE). However, we've just sold a project to a client whose browser was officialy locked as being Google Chrome.
So... I have no idea as of how to solve this problem.
My ContentType instruction is

    Response.ContentType = "application/vnd.ms-excel"

And it goes on below, creating the table with a common html structure.

Help please!! :D

Upvotes: 2

Views: 7611

Answers (1)

John
John

Reputation: 4663

I've tried this with chrome and it works

Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "content-disposition", " filename=yourspreadsheetname.xls"

Upvotes: 7

Related Questions