Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android - Downloaded File is deleted when DownloadStatus becomes Done #5

Open
lorenzocalosi opened this issue Aug 27, 2019 · 6 comments

Comments

@lorenzocalosi
Copy link

I've tested this on different devices, and it only happens when i seem to use a device running Android 7.0. When the download changes status to Done, then the file is deleted. Before that, i can see that the file is present in the correct destination folder, but as soon as it finishes downloading, the file is gone.

@aurimasc
Copy link
Collaborator

aurimasc commented Sep 5, 2019

How do you monitor the files presence? You haven't cleared the files in Download Manager app?

@cseheon
Copy link

cseheon commented Jan 16, 2020

Me too, the file is deleted when the download is complete.
If I don't use 'using', and don't explicitly call BackgroundDownload.Dispose (), it won't be deleted.
The file seems to be deleted during the BackgroundDownload.Dispose () process.

Of course, if I omit Dispose (), the completed download will not be deleted from BackgroundDownload.backgroundDownloads.
This is not what I want

Unity 2020.1.0 / Android 8.0

@aurimasc
Copy link
Collaborator

Gotch, thanks for info.
This should fix it:
#13

@rubit0
Copy link

rubit0 commented Feb 2, 2020

The Issue ist still here.
The workaround with renaming the file works quite well though, just append ".part" to the file path and before reaching the using block use File.Move to rename the file back without the ".part" in the end.

@MantsSk
Copy link

MantsSk commented Feb 12, 2020

@rubit0 Could you clarify what you mean by the "issue is still there"? I'm not able to reproduce the issue anymore with the fix that @aurimasc mentioned :) If you are still reproducing, could you attach an example of your code? Just want to make sure that it doesn't differ with my implementation.

Thank you

@rubit0
Copy link

rubit0 commented Feb 13, 2020

@Sidass I mean that it is not fixed on Unity side and yes the workaround via renaming the file works fine so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants