Can I force a file to be saved instead of opened?

  • Thread starter Thread starter SL
  • Start date Start date
S

SL

Hi - when sending a file to the browser, is there a way to set up the
response headers such that the user is forced to save the file, with no
option given to "open" it?

Thanks for any info,
Sheryl
 
Probably not, but if there was, the effort would be meaningless since the
user can save it and then open it from the desktop. Is there a need to
prevent them from opening it?
 
SL,

Try this:

Response.AppendHeader("content-disposition", _
"attachment; filename=" + name)

I'm not certain that it works with all browsers though...

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

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

Back
Top