[File Plugin] FilePlugin - Read file on internal sdcard

Forge Component
Published on 2018-10-16 by Pedro Oliveira
3 votes
Published on 2018-10-16 by Pedro Oliveira

Hello everyone

I´m working with app mobile and I need read a txt file on sdcard, but I can´t get the path for this file.

I tried to set on path property on GetFileData action many ways e.g:

file:///sdcard or file:\\\sdcard

:///sdcard or :\\\sdcard


Also changing the StorageTypeId Internal or External

The device has Android OS

Anyone can help me please

Hi Artemio,

Seems to be a similar issue of this thread and https://www.outsystems.com/forums/discussion/38330/opening-pdf-in-local-storage-with-file-viewer-plugin/,

There is an answer from Harlin Setiadarma there that could be useful to you in this case:

"For apps targeting Android 7.0, the Android framework enforces the StrictMode API policy that prohibits exposing file:// URIs outside your app. If an intent containing a file URI leaves your app, the app fails with a FileUriExposedException exception.

To share files between applications, you should send a content:// URI and grant a temporary access permission on the URI. The easiest way to grant this permission is by using the FileProvider class. For more information on permissions and sharing files, see Sharing Files."

Best regards

Fabio Fantato