jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes Cannot get Netscape 6.1 to open save as dialog box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Cannot get Netscape 6.1 to open save as dialog box" Watch "Cannot get Netscape 6.1 to open save as dialog box" New topic
Author

Cannot get Netscape 6.1 to open save as dialog box

Tanveer Rameez
Ranch Hand

Joined: Dec 11, 2000
Posts: 158
hi
I have a html file having a URL saying 'click here to download the date file'. When the URL is clicked it calls a servlet and the user sees a save as dialog box. On clicking ok, the data file is saved in the user's computer.
I used the method:
[code]
response.setContentType("excel/csv");
[code]
in the doGet() so that the content will not be displayed by the browser, but the browser will be forced to popup the 'Save As' dialog box as it cannot display such content type.
<b>This runs fine in IE5 and Netscape 4 & Netscape 6.1.</b>
However the default filename that appears in the SaveAs dialog box's FileName textfield is the package name of the servlet. that's funny!! The user can ofcourse change the name if he wants to.
To specify a default file name 'testfile' in the FileName textfield, I added another line :
[code]
response.setHeader ("Content-Disposition","inline; filename=\"testfile\"");
[code]
This runs fine in IE5 & netscape 4, where the 'testfile' appears in the FileName TextField of the Save As Dialog box.
<B>However the Save As Dialog Box fails to appear in Netscape 6.1</b>.Only a message box pops up telling me that Netscape cannot open this file for me, so I have the option to save the file if I want to. When I click on the 'Save As' button, <b>nothing happens</b>. Why does nothing happens after that. The Save As dialog box is suppose to appear.
I would highly apprecaiate if anyone can give me a solution to this problem <b>quick</b>. Just Remember I am having this problem with Netscape 6.1, not with IE5 or Netscape 4.
regargs
Tanveer


Author of JPhotoBrush Pro (www.jphotobrushpro.com)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot get Netscape 6.1 to open save as dialog box