简体   繁体   中英

How to open a file downloaded by DropBox in a Flutter app?

I am trying to create a Flutter app that can open a specific file format. I expect people to use Drop Box (and other similar apps, in the future) to download/sync the files... so I need to be able to access such files from Flutter.

From all I've read so far, mobile apps don't normally have access to the file system except in their own Documents directories, so it seems it's not possible to open a file downloaded via another app.

Is that correct? There must be at least some workarounds, after all, you need to be able to open files in your Drop Box folder using other apps!?

If no Flutter solution exists, can someone point out how to implement such functionality on iOS and Android (I could then write a Flutter plugin that abstracts that away)?

If I understand it correctly, it's not possible to access files managed by DropBox (or any mobile app) from another app without actually integrating with DropBox directly (rather than via the file system).

DropBox has various tools that can be used for this.

The simplest one seems to be to integrate DropBox Chooser into your app, in which case a button is added to the app which allows the user to select the file from a DropBox view ( screenshot ).

Other options include authenticating DropBox users via OAuth then using the DropBox REST API, or including the DropBox SDK , which makes doing that easier (but you have to implement it for both iOS and Android, maybe as a Flutter plugin, as there seems to be no Flutter support).

There's also a Dart DropBox REST client project on GitHub but it seems to be abandoned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM