|
Outputstream not streaming.
In the following code, can anybody please tell me at what point the data actually starts to get transferred and the popup "download file" box appears? I'm thinking that the dialog box should appear on the first outputstream.write and start transferring data. But I don't think that's the case because the "Page cannot be displayed" is displayed after "waiting" for quite awhile. On a smaller dataset (shorter while loop) with less "wait", dialog box eventually appears and the data gets transferred properly. Larger dataset with longer wait always times out.
Is there some sort of a web server configuration that tells it to write out the data ONLY if outputstream closes? I But isn't the default Transport "chunked"? Could it be possible that the web server somehow got configured to never use "chunked"? If so, how would that happen? We're using Oracle AppServer 10g. Thanks - any help would be appreciated.
response.setHeader("Expires", "0");
response.setHeader("Content-disposition","inline;filename=Download.csv");
response.setContentType("application/x-msdownload");
outputStream = response.getOutputStream();
bufferInBytes = this.getData();
while (bufferInBytes != null)
{
outputStream.write(bufferInBytes, 0, bufferInBytes.length);
outputStream.flush();
bufferInBytes = this.getData();
}
outputStream.close();
|