Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent file opening

Status
Not open for further replies.

jianbo

Programmer
Dec 19, 2001
78
0
0
US
In a table I create links for user to download Word documents.
Here is my code:
<A href="someWordDoc.doc">Doc description</A>
I only want to user right click to save this document instead click to open the file. Is there any good way to do that?
Thanks
 
Luckily, there isn't. What happens if I want to open the file in my browser? Shouldn't it be my choice what happens, after all it's my browser not yours?

The closest you will get to what you want is to stream the file from your server-side code to the client and set a Content Type for it that will ask the user whether they want to open/save the file when they click it.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top