aspose file tools*
The moose likes Servlets and the fly likes Servlet Prompting to Save File? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Prompting to Save File?" Watch "Servlet Prompting to Save File?" New topic
Author

Servlet Prompting to Save File?

Brian Swingle
Greenhorn

Joined: Feb 12, 2003
Posts: 14
Hello,
Twice when i've tried to run my servlet which is hosted i get prompted to save a file. Once i make the selection then nothing happens. My response type is set as text/html is that maybe the cause?
If anyone has had this happen to them and could halp it would be greatly appreciated.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
I am unclear here. What is your servlet trying to do? Is it what is asking for the file to be saved or is this outside the functionality of your servlet?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Chris Smith
Ranch Hand

Joined: May 03, 2002
Posts: 42
Brian,
That is definitely a bit odd. A couple possibilities:
1. Are you setting a Content-disposition header? If so, what is it?
2. IE will ignore the reported content type if the URL (minus the query string) ends with an extension that it thinks it knows. What does the request URI look like?
Hernando Guerra
Greenhorn

Joined: Mar 11, 2003
Posts: 3
ya can force it using:
response.reset();
response.setContentType("application/vnd.ms-excel");
response.setHeader ("Content-Disposition", "attachment;filename=\"result.xls\"");
if the file was written on the response output stream, the secret is to use the "attachment;filename..." part
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Prompting to Save File?
 
Similar Threads
How to run sevlet examples on Weblogic Server 5.1
Servlet and I/O
How to write into a file with a servlet (write a remote file)
File Upload from form
BLOB throwing class cast exception