aspose file tools*
The moose likes Servlets and the fly likes Change file name without prompt to save Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Change file name without prompt to save" Watch "Change file name without prompt to save" New topic
Author

Change file name without prompt to save

Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

When I add the setHeader code to change the name it always
prompts me with a save as box. Is it possible to change
the file name without the prompt to save? If I don't try
to change the file name it opens right into Adobe Acrobat.
As I set the Mime Type to "application/pdf".



Thanks,
Tom
Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

I have tried using inline as mentioned this in the is link

http://forum.java.sun.com/thread.jspa?threadID=486951

But the fileName is still the name of the JSP.

Thanks,
Tom
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Change "attachment" to "inline" and it will open in the browser.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

Ben,
I tried that, as I noted in my second post and the same result. It appears I must have something else messed up.
Thanks,
Tom
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Change file name without prompt to save
 
Similar Threads
Save an InputStream to a file
How to get open or save dialog in struts.
How to set browser title using HTTP Header from a Servlet?
response.setHeader("Content-Disposition") not working in IE alone
Save pdf from http inputstream to file