Comments (10)
Yes there is. createFile will resolve the promise upon file creation.
So you can use another library e.g. https://github.com/zo0r/react-native-push-notification to create a notification on promise resolve.
from react-native-blob-util.
The documentDir refers to the apps internal directory so you can't see it from any other app. You would need root access for that
from react-native-blob-util.
We will run into a problem here.
In general with Android 10 / 11, following Apps are not allowed to access files outside of their scope anymore.
So we would be able to store the files outside of the apps directory (e.g. in the public Download directory) but the App would not be able to access it without a user opening it over a file picker.
Only exception would be using certain media file collections like the gallery for images.
One reason for this is exactly what you want to mitigate - that data the app created gets deleted when the app is uninstalled. The best probably would be to first store the file in the apps scope and then copy / move it to another, public location. But currently the app can't do the last part.
from react-native-blob-util.
Hi @RonRadtke Thanks,
Whenever I create a Directory using
ReactNativeBlobUtil.fs.mkdir(ReactNativeBlobUtil.fs.dirs.DocumentDir + '/foldername')
Directory is created and I am able to check that by
ReactNativeBlobUtil.fs.exists
But I am not able to see that directory in physical device
from react-native-blob-util.
Is there a way or a workaround to create file anywhere else other than apps internal storage , as whenever I clear data of my app those files also gets deleted
from react-native-blob-util.
Yes, you can use the downloadDir or the external storage directly. But keep in mind that you might need to request additional permissions for that.
from react-native-blob-util.
Can you please share a snippet for that
from react-native-blob-util.
Tested it myself first. Seems like there are some problems with Android 10 / 11 at the moment.
For these Android versions all paths will be in the apps directory.
Some changes to use the media files api would be required here, so we can use predefined, global locations.
But I'm not sure yet when exactly I will get to implement this
from react-native-blob-util.
Okay thanks
from react-native-blob-util.
0.14.0 was released yesterday implementing the possibility to store files in e.g. the download collection.
from react-native-blob-util.
Related Issues (20)
- How to async/await in `readStream`
- react-native-blob-util--fs.isDir Invocation Error
- iOS privacy manifest HOT 1
- Android Download Manager notification only shows up at the end
- response.json() is throwing an Error in Android saying No such file or directory HOT 1
- dest.exists() check fails in writeStream() in files of type content:// HOT 1
- Using writeStream() with content:// Uris HOT 1
- File gets corrupted with readStream() with base64 when using bufferSize defaults
- java to kotlin change example HOT 5
- pathForAppGroup typescript error HOT 1
- Error opening APK file: installation package is corrupt HOT 3
- Integration network debugging react-native-debugger HOT 1
- Crash when readStream on IOS
- Problem with java.lang.RuntimeException: java.lang.IllegalStateException: Use of own trust manager but none defined HOT 1
- wifiOnly option doesn't work on iOS as expected
- copyToMediaStore does not work on Android versions lower than 10 HOT 2
- Upload Video [Error: The operation couldn’t be completed. Message too long] HOT 3
- [Error: Unexpected FileStorage response file: null] on android 14 HOT 1
- Run error in windows, due to the WindowsTargetPlatformMinVersion
- ReactNativeBlobUtil.fs does not work if path contains 'content://' HOT 1
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-blob-util.