By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

dynamic file download with *long* response time - How to show "Save As" early?

P: n/a
I've got a Java servlet that delivers large database resultsets
transformed to Excel with the HSSF library. In some cases it takes
more than 15 minutes before transformation is done and content can be
delivered to the browser.

I want to show the "Save As" dialog as early as possible so the user
knows he's not lost and forgotten.

I already tried to send the response headers immediately after
receiving the request including content disposition and filename. Even
though the browser receives those headers it just won't trigger the
"Save As" dialog. This applies to both MS IE and Mozilla.

Any ideas appreciated.
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
gu******@t-online.de (W.Guerlich) wrote in message
news:<38**************************@posting.google. com>...

I've got a Java servlet that delivers large database resultsets
transformed to Excel with the HSSF library. In some cases it takes
more than 15 minutes before transformation is done and content can be
delivered to the browser.


With this kind of response time, delivering the complete file
via e-mail seems to be a much better idea...

Cheers,
NC
Jul 17 '05 #2

P: n/a

"W.Guerlich" <gu******@t-online.de> wrote in message
news:38**************************@posting.google.c om...
I've got a Java servlet that delivers large database resultsets
transformed to Excel with the HSSF library. In some cases it takes
more than 15 minutes before transformation is done and content can be
delivered to the browser.

I want to show the "Save As" dialog as early as possible so the user
knows he's not lost and forgotten.

I already tried to send the response headers immediately after
receiving the request including content disposition and filename. Even
though the browser receives those headers it just won't trigger the
"Save As" dialog. This applies to both MS IE and Mozilla.

Any ideas appreciated.


One of those times when the HTTP response code 100 is of use?
--
Obey the Clown - http://www.conradish.net/bobo/
Jul 17 '05 #3

P: n/a

"W.Guerlich" <gu******@t-online.de> wrote in message
news:38**************************@posting.google.c om...
I've got a Java servlet that delivers large database resultsets
transformed to Excel with the HSSF library. In some cases it takes
more than 15 minutes before transformation is done and content can be
delivered to the browser.

I want to show the "Save As" dialog as early as possible so the user
knows he's not lost and forgotten.

I already tried to send the response headers immediately after
receiving the request including content disposition and filename. Even
though the browser receives those headers it just won't trigger the
"Save As" dialog. This applies to both MS IE and Mozilla.

Any ideas appreciated.


That library keeps everything in memory until you close and write the
document. It is useless for large resultsets.

Use either tab/cr delimited data (which can be read by Excel as well) or
generate Excel XML as a stream. That last option is only good for Excel 2003
(2000 also supports a slightly different XML format).

Silvio Bierman
Jul 17 '05 #4

P: n/a
"Silvio Bierman" <sb******@jambo-software.com> wrote:
That library keeps everything in memory until you close and write the
document. It is useless for large resultsets.

Use either tab/cr delimited data (which can be read by Excel as well) or
generate Excel XML as a stream. That last option is only good for Excel 2003
(2000 also supports a slightly different XML format).


On another occasion I successfully used such a hybrid HTML/XML format
readable by Excel 2000. But this time the created Excel file must be
compatible with Excel 97. Even though Excel 97 supports some kind of
HTML format, too, it's not capable of preserving cell formatting.

Since the first couple bytes of each generated Excel file always seem
to be the same I thought about writing those bytes first and stripping
them from the generated document later.

From my observations I can tell that receiving the response header
will make the readyState-property (MS IE only) of the current window
go to "complete" for the browser then knows it's actually a file
download it is receiving.

But that still raises the question: What in the world makes the "Save
As" dialog appear?
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.