I'm trying to download the file and it downloads successfully. But problem I'm facing when I get Download File dialog, and click on Open directly without downloading, it doesn't get opened in the IE 6.0 Windows XP SP2 and gives the error
"Cannot find the C:\Documents and Settings\<username>\Local Settings\Temporary Internet Files\Content.IE5\<session>\<filename>.txt file.
Do you want to create a new file?"
I've specified content-type and "Content-Disposition" in servlet and trying to write the data using FileOutputStream.
Now, same is not the case with Mozila. I can open and view the file without any problem..Is this anything that I've to code IE specific in Servlet when downloading the file?
First of all, don't close the servlet output stream. The container will do that. Second, you might try writing the data to a ByteArrayOutputStream to convert it to a byte. Then, you can set the contentLength of the response and I think that might clear up your issues. If IE doesn't know how long the file is, then it might not think you're done.