force a file to save to computer

B

Brian Henry

Is there a way or method to make a file be saved to the computer instead of
being opened on the web? we wrote a web client messaging system that uses
SSL on our server and when you open a word doc as an attachment it of course
opens in the browser... we want to force the user to save it to the computer
(at the least give them a dialog asking what they want to do with it)
instead of just opening it right to the browser... any way to do this?
thanks
 
S

Steve C. Orr [MVP, MCSD]

Yes, you can force a dialog box that will ask the user whether they'd like
to open or save the file.

Response.Clear()
Response.ContentType = Whatever
Response.Writefile("c:\whatever")
Response.AddHeader("Content-Disposition",
"attachment;filename=whatever")

Here are the details:
http://steveorr.net/articles/EasyUploads.aspx
 

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,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top