aspose file tools*
The moose likes Servlets and the fly likes Error deleting file in servlet code after Internet Explorer download error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error deleting file in servlet code after Internet Explorer download error" Watch "Error deleting file in servlet code after Internet Explorer download error" New topic
Author

Error deleting file in servlet code after Internet Explorer download error

Tom Katz
Ranch Hand

Joined: Aug 19, 2002
Posts: 169

Internet Explorer cannot download %FILENAME% from localhost.
The data area passed to a system call is too small.


I get the above error when attempting to download a large file (412MB). Running Jetty 6.1.5.

The real problem is that after getting this error, the code that deletes the temp file is failing. Just a File.delete call, but it works in cases where the file does download. If I try manually deleting the file, I get errors, so I think that's reason to suspect that Internet Explorer may still be accessing the file somehow.

Anyone seen this particular error code when downloading the file?

Also, any ideas on other ways to delete the file in this instance.

thanks,
Tom
Tom Katz
Ranch Hand

Joined: Aug 19, 2002
Posts: 169
This turned out to be an issue in the file download servlet that was writing to the response stream. It was creating a byte[] that was too large, and generating an OutOfMemoryError.

Once I changed this code to write to the stream in smaller chunks, things work fine.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

thank you for taking the time to post an update
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error deleting file in servlet code after Internet Explorer download error