I have a Struts form and action that downloads a file to the client.  The
servlet code looks like this:

  response.reset();
  AdminSetupForm setupForm = (AdminSetupForm) form;
  response.setContentType("application/download");  // also tried
"application/octet-stream", "junk/xml", etc.
  response.addHeader("Content-disposition", "attachment;
filename=setup.xml"); // also tried other file names and attachment with no
file name
  ServletOutputStream out = response.getOutputStream();
  String exportFile = <generate file contents as a string here>
  response.setContentLength(exportFile.length());
  out.write(exportFile.getBytes());
  out.flush();
  out.close();

This downloads the file properly, but on IE 6.x it corrupts the DOM Document
on the browser.  The form is submitted from JavaScript and all of the
buttons on the form invoke JavaScript functions.  After downloading the file
on IE 6.x, any attempt by JavaScript to reference the "document" object
causes an "Unspecified Error".  Inspecting the JavaScript environment with a
script debugger shows that "document" is no longer an object.

I can't find anyone else having this problem, and I've tried many different
ways to solve it.  If anyone has experience with this, please let me know
what you did.

Thanks,
Eric Hodges


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to