How to check close of DownloadStream?

Hi

I am using DownloadStream to serve files. After the files have been downloaded I need to perform some other steps.

The problem is that there doesn’t seem to be a way to know when the InputStream provided by me is closed by DownloadStream. From all indications it seems the inputstream stream is never closed. I even tried passing in my custom inputstream so that I can trap the close method, but the close mtrhod is never called.


Is there a way to detect when the stream is closed?

Thanks,
Imran

Another weird behavior is when displaying the same page on mobile phones [both Android and iPhone]
, the “getStream” method is called twice, when the link is clicked. Is there any known bug/issue with get stream getting generated twice?