Default Save as type and filename

K

Kit Truong

Hello,

I have an asp page that produces output from a database. This allows a
simple way for the user to save the data to a text file by going to
File->Save as...

The default save as options always defaults to a particular filename and the
save as type is always html, therefore the user has to manually type a
filename and choose Text File (*.txt) as the type.

I remember I was able to overide ride these options with the following code.

Response.ContentType = "text/plain"
Response.AddHeader "Content-Disposition", "inline; filename=myfilename"

This doesn't seem to be working for me anymore.

Any thoughts?

Kit
 
P

Patrice

Would be rather :

Response.AddHeader "Content-Disposition",
"attachment;filename=myfilename.txt"

(attachement instead of inline and note the file extension is included).

Patrice
 
V

Varun

Hi,
I have a same issue. I was trying to export the results from an ASP
page to an Excel spread sheet. Right now, when I click on the export
button the excel spread sheet opens in an IE, which my client don't
like. So, my question is when I click the export button a Save as
dialogue window should appear to allow me to save the file in an .xls
type, with out opening directly in IE. Is this doable.

Really appreciate your time in replying to this.

Thanks,
Srini.
 

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,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top