Delete after download

Is there any way to delete downloaded file automatically after some days(for eg 2 days) of download or make user redownload to view file like in youtube?

When downloading complete, store any value to somewhere… And, check if the value is there, the next logics will work fine…
If, value not there… Ask user again to download the file.

NOTE: Not working if files are stored in user’s Local storage.

1 Like

files are actually stored in user’s local storage.

You can’t delete files from user’s local storage without their consent.

but i want to delete it after some days of download.

Then you’ve to store files in your own storage.

Then ask for storage permission.
WRITE_EXTERNAL_STORAGE
Along with it READ_EXTERNAL_STORAGE permission will be granted.

… and where is the problem?

Word automatically is missing ie i want to delete file automically after 2 days of download date.
I mean i want to add feature like youtube where you can download file and after some time it automatically gets deleted or have to redownload it.

What have you tried so far? So show your relevant blocks.

I am in brain storming phase but nothing coming out.

Try to get on with this …

2 Likes

Here is a solution when you download a file store the file path and time in tiny db.
Every time when the screen is initialised just match the time if it reads above 2 days or so get file path and delete it with file component.

1 Like

is there are any update on this topic