itinance / itinance/react-native-fs

How to write blob/document responseType to device

Open
#898 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
5k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am using axios in my project to make API calls and so I decided to use the same to download a pdf file. I get the response in either blob/document format by using the corresponding responseType in axios call.

But i am not able to write this downloaded content to a file on the device using RNFS.writeFile - an empty file gets created on the device (size 0).

path is RNFS.DocumentDirectoryPath and file is what i have downloaded using axios.
try {
const write = await RNFS.writeFile(path, file);
} catch (error) {
....
}
Is there a way to solve my issue?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.