AddHandler & RemoveHandler Web File Download

I implemented a file download for a Web App using essentially some of the code in the Web Download example program.

It uses an AddHandler to notify when the download is complete. Should I do a RemoveHandler? If some other download happens will this handler event fire if not removed? Can I do the remove in the handler itself?

ALSO —

Is it possible to get the actual file name downloaded? In Safari if you download a file name that exists then it adds a suffix serial number. Since this all happens in the browser I am going to assume that the final file name used is not available to the server.

Thanks.

[quote=136526:@Mark Strickland]I implemented a file download for a Web App using essentially some of the code in the Web Download example program.

It uses an AddHandler to notify when the download is complete. Should I do a RemoveHandler? If some other download happens will this handler event fire if not removed? Can I do the remove in the handler itself?
[/quote]

It depends. You can add the AddHandler when you create the downloader object. I would remove it when you close that object so that all references to the object are destroyed. But you don’t have to remove it after every download.

Just be sure that if your code ends up calling the AddHandler again, that you basically catch that you’ve already added it so you don’t throw an exception. I usually but my Add and Remove Handler calls in a Try-Catch block.