473,574 Members | 2,235 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
5 2593
ak
> 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.


for such long things you should redirect to some page which shows progress
of
your long operation (with JavaScript for example).

--
Andrei Kouznetsov
http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader

Jul 17 '05 #2
gu******@t-online.de (W.Guerlich) wrote in message
news:<38******* *************** ****@posting.go ogle.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 #3

"W.Guerlich " <gu******@t-online.de> wrote in message
news:38******** *************** ***@posting.goo gle.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.

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 #4

"W.Guerlich " <gu******@t-online.de> wrote in message
news:38******** *************** ***@posting.goo gle.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.

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 #5
"Silvio Bierman" <sb******@jam bo-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 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

49
2821
by: Ville Vainio | last post by:
I don't know if you have seen this before, but here goes: http://text.userlinux.com/white_paper.html There is a jab at Python, though, mentioning that Ruby is more "refined". -- Ville Vainio http://www.students.tut.fi/~vainio24
27
5056
by: Curious Angel | last post by:
I have a resume in PDF format and I want anyone who LEFT-OR-RIGHT clicks the link to force the file to be saved, and in any event _not_ opened. Since the PDF will be in his cache in any event, I would just as soon place the employer in control of what directory he wishes to save it in, and there are two salient reasons for this: 1. I want...
28
3387
by: Act | last post by:
Why is it suggested to not define data members as "protected"? Thanks for help!
4
5532
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. When the user clicks to start the download I would like to display the "Save As" dialog, allow the user to name a place to save the file, and then...
5
1875
by: Paul Sullivan | last post by:
We are a state agency that views protected medical information via our intranet. The screens even have privacy shields. Alarmingly, uses can "Print" and "Save As" which destroys the protection of the health information at the level we want. QUESTION: Can we shut those off?? Any other suggestions?? Paul Sullivan
6
1941
by: W.Guerlich | last post by:
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...
3
2537
by: B-Dog | last post by:
I'm checking some files to see if the filenames are in a certain format and if not I want to pull up a dialog box that gives me a save as with the file that is in question. I have all the files in a certain directory and if it doesn't meet my criteria then I want to do a "save as" to a different location. How can I do that. I can't seem to...
6
4736
by: Ryan | last post by:
I have a windows form that I want to force validation on controls (text boxes) when the user clicks a "Save" button. The only way I've found to do this is to cycle through every control and call it's .Select() method. This is clunky though because you can see a flash in each text box as it's being validated. Here's my code Private Sub...
8
3618
by: asenthil | last post by:
Hai to all, if i'm having a file named as "tab.doc" which is a microsoft word document file ... i want to save it as another file as "tab1.doc" by using "save as" method.... Is there any "save as" method available for doing this process in VC++....
60
7926
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I prompt a "Save As" dialog for an accepted mime type? ----------------------------------------------------------------------- It is not possible with client-side JavaScript. Some browsers accept the Content-Disposition header, but this must be...
0
7720
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7810
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5618
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5299
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3739
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1056
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.