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

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
 
P

Peter Rilling

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?
 
S

S. Justin Gengo

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top