*
The moose likes HTML, CSS and JavaScript and the fly likes Downloading only after prompt... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Downloading only after prompt..." Watch "Downloading only after prompt..." New topic
Author

Downloading only after prompt...

Manohar Karamballi
Ranch Hand

Joined: Jul 17, 2001
Posts: 227
Hai All!
Consider this scenario...
I have HTML code to download some PDF file.. And PDF reader is installed in the client machine. Now when i tried to download this pdf on client machine it is directly opening in browser.
Is there anyway that i can control so that system prompts for Downloading before Opening..
This should be generic..That is to say not only for PDF but for all kinds of files..
Any suggestions are appreciable..
Rgds
Manohar
Connie Boyd
Ranch Hand

Joined: Feb 22, 2001
Posts: 73
I'm not sure if this will work for you, but we have done it in the past. If you remove the extension of the file, or give it a strange extension (on both the actual physical file to be downloaded and in the HREF of your html code), the browser will usually not know what to do with it and will prompt the user to download. In order to do this though, you should clearly indicate what kind of file you are pointing to so the user knows what he/she is getting.
Hope this helps.
 
 
subject: Downloading only after prompt...
 
Similar Threads
DownLoading a PDF File
How to download a File From Sun?
file downloading
how to download an jpeg and gif file from a servlet to browser
Download multiple files