By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Default Save as type and filename

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Would be rather :

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

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

Patrice

"Kit Truong" <ki*@e-nablesolutions.ca> a écrit dans le message de
news:pj*****************@news20.bellglobal.com...
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

Jul 19 '05 #2

P: n/a
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.
"Kit Truong" <ki*@e-nablesolutions.ca> wrote in message news:<pj*****************@news20.bellglobal.com>.. .
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

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.