android icon indicating copy to clipboard operation
android copied to clipboard

[FEATURE REQUEST] Export files from scoped storage

Open jesmrec opened this issue 4 years ago • 21 comments

After scope storage is already in, we can provide users a way to reach the files in the device (out of oC) beyond the document provider. Many feedback about getting the files was received, so, this option could be interesting for users of apps that do not implement the document provider (recommended option).

Ideas about it (ACs draft)

  • Exported files will be a copy out of oC. Those copies will not synced anymore.
  • Available for files and folders (with recursivity. Enough memory? -> no crash)
  • New option in three-dot-button, called Export. Also available in the multiselection menu. Check for the best icon "ifRoom"
  • Available in preview mode
  • If selected file is not downloaded, it will be downloaded to be exported (could it be removed afterwards?). Check if it is feasible to download directly in target folder, chosen by the user.
  • The option will show a folder picker to select the target -> system.
  • Conflict handling, out of oC? (f.ex. exporting a file to a folder which contains a file with the same name)
    • Copy recursively: only override/no override (keep original copy)
    • Do it manually

More ideas and feedback is welcome

TASKS

  • [ ] Research (if needed)
  • [ ] Create branch feature/feature_name
  • [ ] Development tasks
    • [ ] Implement whatever
    • [ ] ...
  • [ ] Code review and apply changes requested
  • [ ] Design test plan
  • [ ] QA
  • [ ] Merge branch feature/feature_name into master

PR

  • App
  • Library (if needed)

jesmrec avatar Nov 25 '21 13:11 jesmrec

About the conflict handling: since it seems to be used for media 'sync' purpose, I propose not to copy already existing files or ask whether we want to replace already existing files or not, like on any OS

hugoo10 avatar Nov 29 '21 08:11 hugoo10

About the conflict handling: since it seems to be used for media 'sync' purpose, I propose not to copy already existing files or ask whether we want to replace already existing files or not, like on any OS

no, no sync purpose. It's only a copy to another reachable place. That copy will not be synced anymore.

jesmrec avatar Nov 29 '21 11:11 jesmrec

About the conflict handling: since it seems to be used for media 'sync' purpose, I propose not to copy already existing files or ask whether we want to replace already existing files or not, like on any OS

no, no sync purpose. It's only a copy to another reachable place. That copy will not be synced anymore.

Yes that's why I quoted sync. But you can view it as a one way (OC storage -> phone storage) manual sync

hugoo10 avatar Nov 29 '21 12:11 hugoo10

  • Exported files will be a copy out of oC. Those copies will not synced anymore.

Also before, local changes never synced back to the server.

michaelstingl avatar Nov 29 '21 14:11 michaelstingl

Isn't this sync feature overcomplicating the problem? Many issues are about the new SAF change, like #3462 #3455 #3339 Rather than an additional sync (Meaning files would be stored twice?) Why not just using the MediaStore API to make the files visible in Android/media, in order to let users read their files the way they mean to?

azukaar avatar Feb 03 '22 02:02 azukaar

Perhaps just a usability suggestion: may be provide a tick box on exporting that indicates that the selected folder is the "root" (and have this selection maintained across exports). I.e.:

  • the user navigates to /foo/bar in OC
  • selects folder1 for exporting
  • selects say /sdcard/oc_export, ticking the box that it's "root"
  • the files are exported under /sdcard/oc_export/foo/bar/folder1
  • next time the user navigates to any other folder and taps "export", /sdcard/oc_export is already filled in and the box is ticked (which can be changed of course)
  • this time no selection needs to be done, just tapping "ok" is enough

The reason is to allow easy maintenance of the original folder layout (cause the files have been organized in certain way inside OC by the user for a reason) without making the user manually re-create the whole tree. Remembering last selection allows to export additional folder in 2-3 taps

Another tick like "sync with delete" or something would be ideal to delete those files under exported folder1 that don't exist in OC anymore. I.e., sort of rsync --delete behavior if you see what I mean.

Of course this doesn't allow to edit files on the phone and sync back, but at very least that will remove lots headache from the users who need to at least provide quick and easy read-only access to other apps

Removal of the exported files from OC local storage after exporting would be amazing as well

maxim-kukushkin avatar Apr 22 '22 00:04 maxim-kukushkin