Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Defaulting the filename of a PDF

Posted on 2003-11-12
5
Medium Priority
?
345 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

610 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