Comments (7)
How did you initially save the file? Did you download it with this library?
from react-native-file-access.
Not an expert but did you try adding android:requestLegacyExternalStorage="true"
in AndroidManifest.xml
in <application>
and ask for user permission ?
from react-native-file-access.
From Google Play inbox:
We've detected that your app contains the requestLegacyExternalStorage flag in the manifest file of 1 or more of your app bundles or APKs.
Developers with apps on devices running Android 11+ must use Scoped Storage to give users better access control over their device storage. To release your app on Android 11 or newer after May 5th, you must either:
Update your app to use more privacy friendly best practices, such as the Storage Access Framework or Media Store API
Update your app to declare the All files access (MANAGE_EXTERNAL_STORAGE) permission in the manifest file, and complete the All files access permission declaration in Play Console from May 5th
Remove the All files access permission from your app entirely
For apps targeting Android 11, the requestLegacyExternalStorage flag will be ignored. You must use the All files access permission to retain broad access.
Apps requesting access to the All files access permission without a permitted use will be removed from Google Play, and you won't be able to publish updates.
I got this message show i need remove android:requestLegacyExternalStorage="true" in AndroidManifest.xml. So when i readFile image from sd i got error.
from react-native-file-access.
As you mention, direct/full filesystem access is being locked down on Android. This means that to access an SD card, the app must either be a file manager app (and so have MANAGE_EXTERNAL_STORAGE
permission), or use SAF/Media Store. requestLegacyExternalStorage
is there to temporarily enable apps to migrate storage techniques.
All of the Dirs
constants in this library, except Dirs.SDCardDir
, do not require any special permissions to use. However, they are restricted to only be accessible by this app. This library supports reading storage access framework provided files (on all api calls, if a file is being read from, it can be a SAF link), and writing via Media Store API (see cpExternal()
).
If this does not meet your needs, could you further describe your use case?
from react-native-file-access.
Assuming resolved.
from react-native-file-access.
@alpha0010
Could you share any example how to use SAF/Media Store?
I will try to Implement download mp3 file. That file can not access by other source.
from react-native-file-access.
@MaxJadav Could you open a new issue regarding expanding the documentation? It will make it easier for me to track.
from react-native-file-access.
Related Issues (20)
- Android - getting error while generating apk HOT 2
- [Q] cp (FileSystem.cp) HOT 1
- Build fail on iOS after update v3.0.2, react-native 0.71.8 , expo 48 HOT 6
- Add support for reading files from resource id returned by require() HOT 2
- Add a fallback for cpAsset resource type HOT 3
- Error when calling statDir function with many files HOT 2
- Save dialog support ?
- FileSystem.cpExternal creates a invalid file if the file already access
- Download Manager support like rn-fetch-blob to enable downloads using DownloadManager for android
- [iOS] privacy-related API usage HOT 2
- Unable to find specification for `ZIPFoundation (= 0.9.11)` and `hermes-engine (~> 0.9.0)` HOT 1
- Read file from assets directory HOT 4
- fetch: Failed to connect to localhost/127.0.0.1:PORT HOT 1
- Maven problem HOT 2
- Write Blob, instead of just string HOT 2
- support downloading file in background on iOS
- FileSystem.ls of an empty directory "returns" an error instead of [] HOT 3
- After updating to 3.0.7 on iOS I get: Multiple commands produce '.../PrivacyInfo.xcprivacy' HOT 2
- writeFile doesn't work properly with ciphered data HOT 3
- Unable to run macos Example / unable manually link for macos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-file-access.