Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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: 9550
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
Posts: 15385
6
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!