Comments (7)
@AlmiranteTim You are not allowed to save files in Downloads folder or even take permission of that directory in Android 11 and 12. Hence the issue. It works normally on older android versions.
To solve this, don't take permission of Downloads folder root as it won't work on Android 11 and Above. If you really want to save something in the Downloads folder, use createDocument
method which allows saving a file there.
from react-native-scoped-storage.
@AlmiranteTim You are not allowed to save files in Downloads folder or even take permission of that directory in Android 11 and 12. Hence the issue. It works normally on older android versions.
To solve this, don't take permission of Downloads folder root as it won't work on Android 11 and Above. If you really want to save something in the Downloads folder, use
createDocument
method which allows saving a file there.
I tried, but the pdf file still saves with a size of 0 bytes. Android - 7.1.2, phone - meizu M6 Note
NetworkRepository.LkService.loadElnFile(lnCode).then(async (response) => {
let base64Str = response.data;
let fileName = `ELN_${lnCode}.pdf`;
let mime = 'pdf';
let data = base64Str;
let encoding = "base64";
try{
if (Platform.OS === "android") {
return await ScopedStorage.createDocument(fileName, '*/*', data, encoding).then(() => {
this.isElnFileLoad = false;
})
from react-native-scoped-storage.
@AlmiranteTim The library is being used in a project with thousands of users and I haven't had such a report or issue. I will try to reproduce in emulator & older android versions. Have you tried to reproduce it in a emulator with android 7 installed?
from react-native-scoped-storage.
@AlmiranteTim The library is being used in a project with thousands of users and I haven't had such a report or issue. I will try to reproduce in emulator & older android versions. Have you tried to reproduce it in a emulator with android 7 installed?
Yes, i tried. We also received a couple of messages from users about this problem on android 28,29
from react-native-scoped-storage.
Does it cause an issue in the emulator?
from react-native-scoped-storage.
Does it cause an issue in the emulator?
No
from react-native-scoped-storage.
I have the same problem as this issue
from react-native-scoped-storage.
Related Issues (20)
- Create file using file data HOT 1
- export `exists()` from native module
- Download file from API HOT 8
- Is it possible to copy a file from normal Android file storage into scoped storage? HOT 11
- How to read all files from a folder HOT 2
- deleteFile deletes the entire directory it is in when attempting to only delete one file HOT 1
- How to open a file using default android app HOT 1
- Unexpeted behaviour while writting to a file
- Cannot read property 'openDocumentTree' of undefined HOT 4
- How to enable Manage access to all files
- How to copy image file from one folder to another? HOT 1
- getPersistedUriPermissions returned is difference from openDocumentTree value HOT 3
- await ScopedStorage.copyFile crashes file HOT 3
- Unable to run in Android. HOT 2
- How can i share images/videos with ScopedStorage.getPersistedUriPermissions() url
- Copy external file to the our app document directory
- how to create folder?
- When finelname auto-incremen goes higher than (32) th copyfunction dont comply
- can't write file in android 13 HOT 1
- Doesn't work at all
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-scoped-storage.