Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to avoid open/Save dialog box while downloading?

 
Shamu Somasundaram
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone please tell me how to avoid the dialog box for Open/Save while downloading a file? I don't want the dialog box to appear when I click a link to download.
Thanks in adavnce.
Shanmugavel.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you set the Content-Disposition header using "inline" instead of "attachment" the browser will open the document and show it.
Of course, the client machine will have to have the appropriate application fo r showing the content.

IE: If you send a PDF and the user doesn't have a PDF viewer on their machine, they will be presented with the "download/open with" box.
 
Shamu Somasundaram
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply. But I don't want the file to be opened in the browser. It should open in Excel itself if the file is an excel sheet without the dialog box appearing.
Also if you use window.open to open a file in pop-up in Javascript, how will you avoid the Open/Save dialog box?


Thanks,
Shanmugavel.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Browser will search for that appropriate application, if found then it will open the document otherwise you will get a save file window.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
correct. It will open inside the browser if there's a registered plugin for it.
You have no control over that. And a good thing it is, if a website could launch applications at will on a client computer it could install any software it wanted on that computer. The consequences would be disastrous. Noone would be able to visit any website as doing so would leave them wide open to virusses, spyware, and a host of other baddies.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic