To give a background on what I'm trying to do, I have an application which generates an HTML report. There is a 'Save report' link that allows the user to save the report into a MS Excel file on the client. In the servlet, the application uses Apache POI to build an Excel sheet with the report data. Then the contents of the file are written into the ServletOutputStream to be sent to the client on the browser, which pops up a dialog asking the user to either 'Open', 'Save' or 'Cancel'.
Now the problem is that once this pop-up appears and if the 'Save' button is hit after several minutes (say 5-6 minutes), the saved file turns out to be corrupt. Almost always the file size is 96KB. This doesn't happen on Firefox though. If the save button is hit immediately this problem doesn't occur on IE. Now it could well be some sort of IE behavior with respect to caching or streaming of application data such as Excel, but I'm trying to understand what exactly is happening, if someone has had a problem with such loss of data and if I can have some sort of a workaround to avoid this. (Especially since the user behavior is such that they will almost certainly hit the 'save report' and probably go for a coffee till it downloads) I'm using IE 6 on Windows XP Professional OS.