183
Views
2
Comments
[File Plugin] FilePlugin - Read file on internal sdcard
Question
Forge component by OutSystems R&D
7
Published on 16 Oct 2018

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

sdcard


Also changing the StorageTypeId Internal or External

The device has Android OS

Anyone can help me please

mvp_badge
MVP
Rank: #46

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

Rank: #23570

Artemio Sampayo wrote:

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

sdcard


Also changing the StorageTypeId Internal or External

The device has Android OS

Anyone can help me please

 

Hey, did you solve that issue? If yes how? Thanks <3