Solved

Defaulting the filename of a PDF

Posted on 2003-11-12
5
338 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
  • 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 100 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to count occurrences of each item in an array.
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now