How do I get the temporary filename on network.download?

While using network.download, a temporary file is created until the whole file is complete.

I monitor progress and allow the user the option of canceling the download (network.cancel). The problem is that the temporary file is left behind, and I need to delete it.

How do I get the name of the temporary file so that I can delete it on a network.cancel?

Why do you need to delete it?  The system should take care of that for you at some point.

Thanks for the quick response!

It’s the “at some point” that is the problem to me.

I’d rather clean up after myself, immediately. Seems like a potential resource issue if the user stays in the app long enough. BTW, in the simulator, they accumulated quite a bit while debugging and never saw a clean up.

Ideally, network.cancel would return the name of the temp file or delete temporary files itself.

I guess for now I’ll just let the O/S clean up my dirty laundry.  :wink:

I would think that cleaning up after itself would make sense. Can you file a bug report using the Report a Bug link at the top of the page.

Thanks

Bug report filed. Case 23558.

Why do you need to delete it?  The system should take care of that for you at some point.

Thanks for the quick response!

It’s the “at some point” that is the problem to me.

I’d rather clean up after myself, immediately. Seems like a potential resource issue if the user stays in the app long enough. BTW, in the simulator, they accumulated quite a bit while debugging and never saw a clean up.

Ideally, network.cancel would return the name of the temp file or delete temporary files itself.

I guess for now I’ll just let the O/S clean up my dirty laundry.  :wink:

I would think that cleaning up after itself would make sense. Can you file a bug report using the Report a Bug link at the top of the page.

Thanks

Bug report filed. Case 23558.