Solved

Defaulting the filename of a PDF

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to run a side-by-side staging website 16 66
Create associate webpages / websites 3 80
Problem to echo 6 97
Fulfillment API php code sample 1 41
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…
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
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…

810 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