Win a copy of Serverless Applications with Node.js this week in the NodeJS 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Save /Open option for file download  RSS feed

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...

Posts: 9558
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.
Posts: 15385
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
global solutions you can do in your home or backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!