[Project_owners] How to be notify at the end of a download with the Download Manager

Didier Ernotte didier at ernotte.com
Wed Dec 7 17:36:55 EST 2005


I finaly find a way to have 2 listeners on my nsIWebBrowserPersist; I
have create my own implementation of a nsIWebProgressListener, then I
have associated the persit.progressListener to my listener, and my
listener calls the downloadManager listener for all methods to be
implemented in the interface.

Didier

--- "Eric H. Jung" <grimholtz at yahoo.com> wrote:

> Have you looked at nsIDownloadManager.DOWNLOAD_FINISHED?
>
http://www.xulplanet.com/references/xpcomref/ifaces/nsIDownloadManager.html
> 
> 
> --- Didier Ernotte <didier at ernotte.com> wrote:
> 
> > Hi,
> > 
> > I'm trying to use the FF built-in DownloadManager to download a
> file
> > from an URL to the local filesystem.
> > I finaly found that the DownloadManager is just a "view" concept
> that
> > accept a nsIDownload object and display a progression bar and some
> > other status, but does not do the download itseft. I have created a
> > nsIWebBrowserPersist to do the download and I have linked the
> > DownloadManager to the nsIWebBrowserPersist to take care about the
> > progression of the download, but I want to be notified when the
> > download is complete. 
> > What I understand is that I need 2 listeners, one is the
> > DownloadManager, the other is mine. How can I do this ? I have read
> > some code on the mozilla forum to cope with this : a timer to read
> > the
> > status of the download on a regular basis.... This is no very
> elegant
> > :-(
> > Any better solution ?
> > 
> > Thanks
> > 
> > Didier 
> > _______________________________________________
> > Project_owners mailing list
> > Project_owners at mozdev.org
> > http://mozdev.org/mailman/listinfo/project_owners
> > 
> 
> 
> 
> 		
> __________________________________________ 
> Yahoo! DSL – Something to write home about. 
> Just $16.99/mo. or less. 
> dsl.yahoo.com 
> 
> 



More information about the Project_owners mailing list