Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Downloading only after prompt...

 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic