How do you read an "alien" file from Download under SDK 30?

Goodday, I've tried to read an "alien" CSV file (that was written to download directory by OTHER App) using standard FILE component but it gives a permission error. I tried to copy this file from Download to assets/ASD with FILE and also with Taifun.File extension in order to read it after with FILE but there is always an error during copy (using all available scopes).
Changing in APK the SDK from 30 to 29 - everything is working perfectly, but i need to put my APP to Google store which required AAB with sdk30.
Did anybody find the solution of reading file created by other App under sdk30 (from Downoad or ANY other directory)?

You cannot access non-media files on devices with Android 11+ that are not created by the app itself since targetSdk = 30. You must use the Storage Access Framework (SAF) for this.

Also, did you read this?

Yes. I understood everything but I didn't find the solution!
As I understood from the previous answer - the only solution for me is to install and to try to use SAF extension and to read file from
/storage/emulated/0/Downloads/ (and not Download)
I'll try

Hello Alexandre,

This solution seems to be working for me on Android 11.

These blocks are draggable - you can directly drag them into your workspace, but you need to import this extension first.

You will need the following SAF extension.

AIA: Files.aia (30.0 KB)

1 Like

Thank you, but in your example the file was created by the same APP. In my case this file was created by another APP and it changes the situation dramatically in sdk30.
I'm trying to use SAF reading already created file from Downloads directory but till now it was also unsuccessful

It crashes the system if you try to do so. Google changed a lot of things, especially the 908 error, during the latest versions of Android, and we're all not happy about that.

1 Like

Easiest workaround is to upload your alien file to an online resource or local server, then pull the file in to your app using the web component. Then the app will own the file and it will be stored in your ASD. There are apparently working methods to copy/move the file to "shared storage", but unless you need the file there, leave it in your ASD for use by your app.

1 Like

This is all you need:

grafik

2 Likes

Thank you Johannes! I'd like to check your solution but unfortunately I'm not able to find a FileTools extention. Do you have a working link? Thank you again

I found a link to that.

Thank you very much Johannes!!! It works perfectly!! It's exactly what I need!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.