• Post Reply Bookmark Topic Watch Topic
  • New Topic

Save /Open option for file download  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I am using TOMCAT webserver and my application has file upload and download feature.Here, for each file(once uploaded),I need to provide 2 links. [download] and [View]....."download" option should give the user the option to save/open the file...and "view" option should open the file directly in th current browser...

When I use <a href="filename">download</a>, the file gets open in the browser directly...This is desired when I click on "View" but not on "Download"...How can I achieve both...Please help me...

Regards
KSPShenoy
 
Bartender
Posts: 9489
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that is browser behavior determined by the MIME type of the data. There is certainly no way to control it from the IO stream perspective. I'm going to toss this over to the HTML forum and see if they have any input.
 
author
Rancher
Posts: 15385
6
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!