Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Setting headers for file downloads

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the coding to when we send the response as pdf in servlet?






[Ben Souther]
Changed subject to something meaningful
[ March 10, 2006: Message edited by: Ben Souther ]
 
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read your previous post first.
[ March 10, 2006: Message edited by: Chetan Parekh ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rangarajan Balasubramanian,

Welcome to Javaranch.
To help you get the most from these forums, we've compiled a list of tips for asking questions. The complete list can be found here:
http://faq.javaranch.com/view?HowToAskQuestionsOnJavaRanch

In particular, please read:
http://faq.javaranch.com/view?UseAMeaningfulSubjectLine

In response to your question, you would want to set the Content-Type and Content-Disposition headers.

The servlet spec provides a convenience method for the content type.
The content disposition can be set with the setHeader method.

Here is an example for an Excel file.

[ March 10, 2006: Message edited by: Ben Souther ]
 
Well THAT's new! Comfort me, reliable tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic