• Post Reply Bookmark Topic Watch Topic
  • New Topic

File Downloading in IE6

 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I know there are a LARGE number of posts (on javaranch and in general) on how to properly have my code allow downloading of a text file without displaying the file contents in the browser. The forum postings that had solutions seem to fail thus far, in reference to contentTypes.
I'm specifically concerned with download of a tab-delimited text file.
Why does the following code (a snippet from a simple JSP) pop the text file contents into the browser window, instead of through a Save-As dialog?

Note that I've used the following contentTypes:
text/plain (ha!)
application/octet-stream
application/x-filler
application/RFC822
application/text (which I know isn't a real one)
This happens with Internet Explorer 6, both pre-SP1 and SP1, using default settings (what came on install).
What obvious thing am I missing?
Also, is there a utility out there similar to ASP's SAFileUP (for download, not uploads)?
--
[ October 19, 2002: Message edited by: Toby Davis ]
 
Toby Davis
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually found a workaround that I've tested only on IE 6. Code changes as follows:

Very happy this works, though I haven't yet tested on IE 5/5.5.
This, hwoever, leads to another problem. If a user cancels a download in the middle of streaming, the browser process stops properly. However, the app server is still running at full power as though still sending the file.
Is there a way to detect a cancellation on the browser-side, in order to kill the stream on the server-side? Ends up using CPU loads that should have stopped.
This is especially an issue with larger downloads...
Thanks in advance.
---
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!