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!

Forcing "Save As" Box

Status
Not open for further replies.

hotmac23

Programmer
May 3, 2001
3
0
0
LB
I have a link to a document file (<a href=&quot;/word/filename.doc&quot;>Download</a>). When the user clicks on the Download, the file is openning in IE.
Does any one know how to force the browser to open the &quot;save as&quot; box when clicking on a link pointing to a word document file?

By the way,

- I cannot zip the files to be downloaded. They must be document files (.doc)

- I cannot let users view the files in the browser cause they are very big files (5 MB and above) and that will create traffic on the server.

- I cannot block the left-click mouse button and alert the user to right-click and select &quot;Save Target As&quot;. My client did not accept this. He said this is unprofessional from a business point of view.

Thanx in advance....
 
Try to rename your file to filename.zip ________

George
 
Open winzip,
Add your .doc into it and make it as a .zip files.
Try the command in the HTml page.,

<a href=&quot;/word/filename.zip&quot;>Download</a>.

Once the user Clicks the Download button, it open the Save as dialouge box.

Regards,
Mathan.
 
You could try this:

1) create an ASP page that will take a querystring variable that identifies the file
2) put these lines in your file:

Response.AddHeader &quot;content-disposition&quot;, &quot;inline; filename=&quot; & filename
Response.ContentType = &quot;application/octet-stream&quot;

3) on this ASP page you read the file from disk (maybe using the ADO Stream object) and write it to the page using BinaryWrite

This should cause a prompt to come up that says that they are downloading file.asp (or whatever you named your ASP file), but when they click save to disk, they will have the filename as the default name in the box. I hope this works for you! &quot;A computer scientist is a person who knows when it is time to hit the computer.&quot;

John

johnmc@mvmills.com
 
The problem is that each user can set IE options and you cant force a registry change without them knowing.
I will look into it for you if you havent already found a solution...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top