Skip to content

Support for download task cancelled callback and temporary file clean up #2842

@rh101

Description

@rh101

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

If a download task is cancelled via the DownloadTask::cancel() method, it would be really helpful if the Downloader would trigger a callback once the task is actually cancelled, in order to do some clean-up, similar to how onTaskProgress/onTaskError etc. are handled.

Also, partially downloaded files seem to not be deleted, with the .tmp and .tmp.digest remaining. It would be good to have an option to clean up these files via the Downloader. Perhaps even update the DownloadTask::cancel() method to be DownloadTask::cancel(bool cleanup = false); to keep existing behavior by default, but cleanup to true if the temporary files should be deleted.

Describe alternatives you've considered

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions