Rank: Newbie Groups: Member
Joined: 9/16/2010 Posts: 1
|
What is the best way to display a progress bar for a downloader that creates dynamic content? The dynamic content that we are generating can take a bit of time. Ideally, we'd like to show the progress of the generation of the dynamic content. Part of the challenge is getting the different pieces to work together. I'm assuming that I will need to create a dialog with a progress bar and display it in the OnDownload handler. I don't really see how I can update the progress bar from the DynamicDownloadContent generator. It is a separate class that does not have access to the progress bar. Any suggestions?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,195
|
Hi,
You should avoid using them together for such scenarios. All browsers have built-in downloading progress bar support, so it is not necessary to have a separate progress bar just for the downloading part, doing so will only complicate things. Another factor is in order for the progress bar to work properly, you have to have the total content length from the very beginning. This is often not possible when the content is dynamically generated.
Considering those factors, the best approach would be to separate them. You would have a "content generating" task and a "download" task. The "content generating" would be a background task to generate your content, most likely to a temp file somewhere on your server. You would then use the Downloader to download it. The benefit of using a Downloader in this case is you do not have to write different code for different browsers, and it can also hides the real file path for you.
Thanks!
|