schulcloud-flutter icon indicating copy to clipboard operation
schulcloud-flutter copied to clipboard

Make it possible to view files without downloading them to storage

Open MarcelGarus opened this issue 6 years ago • 3 comments
trafficstars

Is your feature request related to a problem? Please describe. Just like the native Android app, we should allow the user to view files without downloading them to storage.

Describe the solution you'd like We could possibly do that by downloading them to a temporary cache directory and starting an intent to open them.

MarcelGarus avatar Sep 18 '19 11:09 MarcelGarus

Blocked by https://github.com/fluttercommunity/flutter_downloader/issues/263

MarcelGarus avatar Mar 12 '20 11:03 MarcelGarus

Viewing files without downloading them to storage isn't exactly possible because other apps opening the files need them to be in the external storage. But I believe by solving #60 it doesn't become apparent to the user that the files are downloaded to the storage, so this should be fine.

MarcelGarus avatar Mar 18 '20 16:03 MarcelGarus

@marcelgarus Not quite true. You can store downloaded files in your app's private directory and grant other apps temporary read access to it: https://developer.android.com/training/secure-file-sharing/share-file#GrantPermissions (This is implemented in open_file: https://github.com/crazecoder/open_file/blob/34dc2cbdeb0d49a83be59f66cbc6e1a258dc2420/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java#L142)

JonasWanke avatar Mar 18 '20 17:03 JonasWanke