781flyingdutchman/background_downloader

Save to SAF folder

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe.
I target clients using android versions above 30, which require SAF (Storage Access Framework) to save files outside the internal storage. Currently, files must be downloaded locally and then manually moved to an SAF/URI folder. I would like an option to download files directly to an SAF/URI folder.

Describe the solution you'd like
Allow files to be downloaded directly to an SAF folder as described above.

Describe alternatives you've considered
The current alternative is saving files to local storage and then moving them to an SAF folder.

Additional context
Currently, there seems to be no way to achieve this. If this feature is already implemented/ there is a more simple way, I apologize for the oversight.

Thanks for raising this. Currently not available - I recently implemented the option to use mediaStore UIRs for uploads (see #398) but then realized that that is only a small part of the URI space in Android (see #415). Storage management on Android is complicated and fragmented, so I am not currently committing to implementing this.

The currently suggested approach for what you describe is to download to a temporary location (not necessarily the temp directory, as that also has complexity in Android) and move ito your desired destination. You'l have to use another packlage to obtain the URI and move the file there. Perhaps take a look at this which explains a new feature that would allow you to execute the move upon completion of the donwload/upload, even if the app is in the background.

Thank you for your response!
I've already implemented this in my application and only wanted to bring it to your attention in case it could be considered for future updates.
Currently, I’m using the package mentioned in (398), but I’d love to see this feature integrated down the line someday as it would bring away complexity and error handling away from the clients.
Regardless, thank you for creating such an amazing plugin!

This issue is stale because it has been open for 14 days with no activity.

This issue was closed because it has been inactive for 7 days since being marked as stale.