file download using servlet and showing progress
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
hi,
In my web application, I need to provide functionality to enable downloading of a file from the server using a servlet. After having provided that functionality by means of the following code,
I now need to display progress/status as to whats happening on the server side. The file being downloaded is a result of a few operations like generating pdfs and merging them. This takes quite some time and until then the client is left in the dark and all he can does is stare at a blank browser window. So as to enrich user experience I wanted to show progress of the files being merged and also the size of the end file that has been downloaded before it finally opens on the browser window, Is this possible and is there any particular pattern to follow.
Thanks
Vijai
In my web application, I need to provide functionality to enable downloading of a file from the server using a servlet. After having provided that functionality by means of the following code,
I now need to display progress/status as to whats happening on the server side. The file being downloaded is a result of a few operations like generating pdfs and merging them. This takes quite some time and until then the client is left in the dark and all he can does is stare at a blank browser window. So as to enrich user experience I wanted to show progress of the files being merged and also the size of the end file that has been downloaded before it finally opens on the browser window, Is this possible and is there any particular pattern to follow.
Thanks
Vijai
When you say "I wrote a program that crashed Windows," people just stare at you blankly and say "Hey, I got those with the system, for free." <br />Linus Torvalds
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I do this by kicking off the long running process in a new thread and then immediately returning the user to a status page.
The status page refreshes itself (using a META tag) every n seconds to check with server. If the job is not done, I return the status page. Once it's finished, I stream the file or forward to a page with a link to the file.
If you're interested, I have a small demo app that does this.
http://simple.souther.us/not-so-simple.html
Look for LongRunningProcess.
The status page refreshes itself (using a META tag) every n seconds to check with server. If the job is not done, I return the status page. Once it's finished, I stream the file or forward to a page with a link to the file.
If you're interested, I have a small demo app that does this.
http://simple.souther.us/not-so-simple.html
Look for LongRunningProcess.
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
To reduce page flickering you can use JavaScript with a timer for updating only status bar.
Retire your iPod and start with HD Android music player Kamerton | Minimal J2EE container is here | Light weight full J2EE stack | and build tool | Co-author of "Windows programming in Turbo Pascal"
posted 12 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Vijjai,
Can you please post your solution to your problem in case you have!
Can you please post your solution to your problem in case you have!
| Straws are for suckers. Now suck on this tiny ad! Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |











