Saving a csv file through ASP.NET

M

M. D'Costa

Hello,

I am saving a csv file through an ASP.NET web application. The data is
obtained from a database and
saved to the local users machine.

I am using the Response objects methods of Addheader and ContentType. It
works fine on my machine to save the file, however on another machine
browser(Internet Explorer), it prompts to save the aspx page. When I say to
save the aspx page, it then opens up the 'save dialog box', and saves the
csv files without any problem.

I think this is a setting on the browser, where it prompts to save the aspx
page, any ideas on how to change this?

Thanks,
Marise
 
G

Guest

I believe this should work

Response.AddHeader("Content-Disposition", filename.csv);
Response.ContentType = "text/csv";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top