Comments (14)
Merged. Sorry for being late, didn't get a notice on this PR. I came across this one while reading thru recent pull request. Please upgrade to v2.13.
from react-native-fs.
@itinance can you please merge my PR?
from react-native-fs.
@paulondc Is there anything we can do here?
from react-native-fs.
Hi @johanneslumpe,
I believe by having a way to trigger the mediascanner through native-fs would be beneficial for the library, I can see this feature being useful for any application that create files under shared places which are meant to be shared across different apps (like pictures), therefore this feature would be in line with the library, since this just makes the files generated by them available in android's mediastore:
I was thinking something like:
@ReactMethod
public void updateMediaStore(String path, Callback callback) {
...
}
What do you think about it ?
from react-native-fs.
@paulondc I'm not sure that this really belongs into the library. I'd kind of like to open this one up for discussion and see if other people think it's useful before we make a decision on this.
from react-native-fs.
+1 this is very useful for me. I cannot see downloaded image at Gallery unless restart the device
from react-native-fs.
+1
from react-native-fs.
When I used Android File Transfer to check the files on Android, and the folder wasn't there after mkdirs, due to this reason. It's necessary to show the folder to user, somehow, they can download their assets directly there, or the app will be complex to have function to be the same for them.
If the folder or file changes can be shown after it created, or even after the device reboot, will be good, looks like it can't for now.
Anyway, to build a native module by adding MTP scan API out of this lib is also possible, but if this lib can provide this as separate API sets, will be very helpful.
I believe this problem also happened in deleting a file, for example Image, then we can't see this change in system gallery or else.
from react-native-fs.
+1
from react-native-fs.
This is still an issue. This library needs scanFile function like rnfetchblob https://github.com/wkh237/react-native-fetch-blob/wiki/File-System-Access-API#scanfilepathstringpromise-android-only. I currently need to use both libraries only for this function. PR #155 Added this function but it was closed.
from react-native-fs.
Hm... seems that we should reactivate this mentioned PR, @lefoy
Do you want to do another PR with that?
from react-native-fs.
PR #544 should solve this issue. Using this method I can save images to my gallery and see them immediately. Thank you for your quick reply @itinance .
from react-native-fs.
Please please @itinance merge @lefoy PR. I also need to have rn-fetch-blob installed to only use scanFile.
from react-native-fs.
If you have saved the file, but it doesn't appear in the gallery, just add scanFile
after success
RNFS.copyFile(imageUrl, newPath)
.then(() => {
RNFS.scanFile(RNFS.PicturesDirectoryPath); // add this
})
.catch(err => {
const message = err?.message;
});
it works for me, and the image immediately appears in the gallery
from react-native-fs.
Related Issues (20)
- CacheDirectory clearing data in IOS HOT 1
- RNFS.readDir(path) only returns folders in directory files are excluded HOT 3
- Installing react-native-fs causes app to crash. (Invariant Violation: requireNativeComponent: "RNSScreen" was not found in the UIManager.) HOT 1
- Upload timeouts HOT 2
- downloadFile 并不是一个Promise对象 await无效 HOT 1
- [improvement] downloading file in background on iOS
- How integrate with react-native use Kotlin (RN: 0.73.0) instead of Java for Android? HOT 5
- Jpk
- Could not resolve all files for configuration ':react-native-fs:androidJdkImage'. HOT 1
- ZIP files corrupted - END header not found
- Access denied
- can't get mp4 files from external storage(from smartphone) In android
- readFileAssets block/freeze the UI HOT 1
- Support for New Architecture HOT 1
- Issue when run the app on device in android or ios HOT 1
- sometime stat size return as 3, Please check HOT 1
- Upgrade Newtonsoft.Json from 10.0.3 to 13.0.1 to fix the vulnerability.
- Could not find the path of SD card HOT 1
- Wrong sha1 checksum for large files (around 1GB) HOT 2
- Please update android compileSdkVersion buildToolsVersion minSdkVersion targetSdkVersion 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-fs.