Solved

Defaulting the filename of a PDF

Posted on 2003-11-12
5
343 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 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

690 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