fs.stat failed on large File
See original GitHub issue- “rn-fetch-blob”: “^0.10.15”
- “react-native”: “0.59.8”
Hi, i am trying to get an absolute path to my file which is selected with react-native-document-picker with uri : “content://com.android.providers.media.documents/document/video%3A69534”.
However, it only works if the file is not too large, in around 11MB, it will throw error when selecting file around 200MB.
The error message highlighted :
"message:“failed to stat path /storage/emulated/0/......
because it does not exist or it is not a folder”
Below is the snippet of code i have :
DocumentPicker.show(
{
filetype: [DocumentPickerUtil.video()],
},
(error, res) => {
if (res != null) {
RNFetchBlob.fs
.stat(res.uri) // res.uri = "content://com.android.providers.media.documents/document/video%3A69534"
.then(stats => {
console.log(stats);
res.path = stats.path;
this.onItemSelected(res, this.addFile);
})
.catch(err => {
console.log(err);
});
}
}
);
Or is there alternative way for me to get an absolute path to the selected file?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:7
Top Results From Across the Web
“Unknown system error -75” nodejs fs.stat large files #19455
This error can occur when, for example, an application compiled on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat() on a file whose ...
Read more >Problems with use fs.stat in nodejs
Your console.log is outside your fs.stat callback. Fixed it: var fs = require('fs'), size = new Object(); function writeinfile(file){ ...
Read more >Node.js fs.stat() Method
The fs.stat() method is used to return information about the given file or directory. It returns an fs.Stat object which has several ...
Read more >Node.js - File System
The Node File System (fs) module can be imported using the following syntax − ... return console.error(err); } console.log(stats); console.log("Got file ...
Read more >How to Process Large Files with Node.js
Basic knowledge of the Node.js fs module; A large sample CSV file. For sample data, you'll be using New Zealand business statistics from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t if that helps. But I removed all the spaces between the file name and that actually works.
Have you tried
RNFetchBlob.fs.stat(decodeURIComponent(uri))
?