The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
September 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

oops, still doesn't work with an .xml extension.

Posted by steven suh on July 12, 2001 at 3:42 PM


I don't know how to trigger an .xml file for download in IE5.5. If you have an .xml with the code I provided earlier than the save as dialog box won't even open. You can get around this but excluding the setHeader method entirely so the code will look like this:

if (this.downloadType.equals(DOWNLOAD_FORMAT_XML)){
res.setContentType("text/octect-stream; name=\""+ fileName+"\"") ;
// res.setHeader("Content-Disposition", "attachment; filename="+ fileName + "\";") ;
}if (this.downloadType.equals(DOWNLOAD_FORMAT_XML)){
res.setContentType("text/octect-stream; name=\""+ fileName+"\"") ;
// res.setHeader("Content-Disposition", "attachment; filename="+ fileName + "\";") ;
}

I said text/octec-stream but I think you can say just about anything.

The save as box will trigger, but the name of the file will be the name of servlet and some session info. If you just change the name and put an .xml extension on the end then the file will save correctly. Sucks, I know. Does anyone else out there have anything to add to this?

I'm assuming they fixed this bug in IE6.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us