Questions tagged [react-native-fs]
165 questions
2
votes
2 answers
React-native Invalid UTF-8 detected while trying to read a image file
I am trying to read an image file using the URI using react-native-fs and redux-saga:
file:///var/mobile/Containers/Data/Application/605FB6C0-869C-4128-883E-A59616933C64/Documents/images/52108C66-A087-4942-9DD4-22CBD0327089.jpg
Below is the line…
Sumanth Jois
- 2,862
- 2
- 21
- 35
2
votes
1 answer
which react native library should i use to access music files locally stored on android
I want to access and run music files stored locally on android and ios devices.
I tried using react-native-fs but couldn't managed to access. So are there any other better libraries available to use it.
HSBP
- 599
- 2
- 6
- 19
2
votes
0 answers
Preview and upload react-native-camera recorded video
I'm trying to implement a camera in a React-native app. The goal of the application is to record a video and upload it and then delete it from the phone. I managed to record the video using react-native-camera.
React-native-camera returns a path for…
user6719137
- 161
- 2
- 12
1
vote
0 answers
react-native-fs [Error: Directory could not be created]
I am trying to create a directory using RNFS.mkdir, but it's warning "Directory could not be created"...
"react-native-fs": "^2.18.0",
"react-native": "0.64.0",
The function that I use to write is the following:
const phoneStorageDir =…
Mateus FlowinTech
- 25
- 7
1
vote
1 answer
Why my code doesn't run after my react-native-ffmpeg promise?
After downloading video and audio, I use react-native-ffmpeg to get the final video file. It works. I want to delete the 1.mp4 and 2.mp4 when I get the final video file. The problem is that the code after await getFinalVideo(path, path1, path2,…
Hidden
- 11
- 3
1
vote
0 answers
How to access files from a hidden folder in react-native-fs
I am not able to access files from a hidden folder /WhatsApp/Media/.Statuses in react-native-fs. Whenever I access I get back an empty array. I have granted READ_EXTERNAL_STORAGE permission (Android). My code goes like this :
import RNFS from…
Shashank
- 11
- 3
1
vote
1 answer
Unable to read file contents in react-native >0.59
I want to upload documents in my react native app and for that I am using react-native-document-picker
But to read the base64 content of the file react-native-fs is needed which has a dependency issue (needs react-native v0.59)
I am unable to…
salvi shahzad
- 542
- 5
- 16
1
vote
0 answers
How to slice a file into chunks in react-native
ImagePicker.launchImageLibrary(options, (response) => {
createChunks(response);
});
I got file uri,path from imagepicker, i want to divide the file into chunks and upload as form data,How to divide the media file(mp4,etc) into chunks in…
Ajith
- 587
- 7
- 32
1
vote
0 answers
React Native import RNFS get Native module cannot be null
I'm developing a react-native application, when I try import RNFS from "react-native-fs" I get the following message:
Invariant Violation: Native Module Cannot Be Null
What's wrong with that?
Vito Lipari
- 600
- 6
- 18
1
vote
1 answer
Manual link react-native-fs in react native
I'm mac user and "react-native link react-native-fs" doesn’t work for me. How to manually link this?
its just matter for me to work in android.
and please check that im do the right thing till here
first thing i do is
npm install react-native-fs…
ezio aditore
- 11
- 1
1
vote
0 answers
How do you copy a file to and from an external USB drive in iOS/iPadOS?
I'm building a react native app where I need to view the contents of an external storage device and copy files to and from said device through my app. On android I'm using an sd card mounted on a USB adapter and connected through a USB C cable). I…
samkhan27
- 764
- 4
- 5
1
vote
1 answer
Uploading a file to GraphQL using Apollo Client
I am currently trying to upload a file (an image from RNCamera) from a react native android app to a GraphQL backend. However, the backend always returns status code 400.
So far, I have tried using another query that only requires a string (instead…
Johannes Vitt
- 31
- 4
1
vote
0 answers
React Native FS readFile returns invalid path for iOS
I have the functionality to readFile using RNFS library and CameraRoll of React Native.
Here is my code below:
const base64Image = await RNFS.readFile(uri, 'base64');
It's working fine for Android but not in iOS.
Here is the error for iOS…
joyce
- 115
- 2
- 6
1
vote
0 answers
Download a pdf and save to device (ios and android) in react-native
I am pretty new to react-native (app development as such).
I want to download and save a pdf file in user's device in react-native? react-native-fs and rn-fetch-blob showed up as popular options.
I am using redux-saga in my project and axios to…
Shriprada S
- 143
- 3
- 9
1
vote
1 answer
How to get folder size and lenght in react native
How to get folder size and number of files in a folder? I try with react-native-fs readDir.
let pat2 = RNFS.DocumentDirectoryPath + '/myFolder'
RNFS.readDir(pat2)
.then((result) => {
console.log(result.size)
})
.catch((err) => {
…
Ismeet
- 249
- 2
- 11