Mark B. – tech

Undetected File Type when downloading Excel File (ASP Classic)

Sometimes when downloading excel file from website, we get unknown file type (*.File).  To fix this, just add the content-type of file that you want to download. exp : “application/”.

sample code :

Response.ContentType = "application/";
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName.Trim() + ".xls");

This entry was published on April 18, 2011 at 4:12 am and is filed under IT Problem Solving. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: