?
Solved

Defaulting the filename of a PDF

Posted on 2003-11-12
5
Medium Priority
?
344 Views
Last Modified: 2010-04-06
I am using structs and iText to generate a pdf and write to a response stream. I had set the content-disposition as inline so that the pdf will be displayed directly in the browser. The user will have the option to save the pdf. When I click save, the default filename given in the save option is the servlet or action name. How can I change the default filename to specific value like "file.pdf"?
0
Comment
Question by:RayLeong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 13

Expert Comment

by:lozloz
ID: 9737872
Content-Disposition: attachment; filename=file.pdf

is the header, i think..

loz
0
 

Author Comment

by:RayLeong
ID: 9738289
I want the PDF to be displayed inline first, than the user can choose to save a copy. When they press save, how can I specify the default filename? In order to display on the same window, I am using
Content-Disposition: inline; filename=file.pdf

0
 
LVL 13

Accepted Solution

by:
lozloz earned 400 total points
ID: 9738869
when they click save, you could open up a php window which sends the file as an attachment directly through the header, that's the only thing i can suggest

loz
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question