itinance / itinance/react-native-fs
Error when uploading image to cloudinary
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I'm trying to upload an image and I'm getting this error
```
Error: ENOENT: no such file or directory, open 'https://api.cloudinary.com/v1_1/*****/image/upload?upload_preset=******' at createErrorFromErrorData
```
this is my code:
```javascript
var files = [
{
name: "test1",
filename: "dc504e13-2332-4e67-abba-7217a8778e6d.jpg",
filepath: "/data/user/0/com.example.example/cache/Camera/dc504e13-2332-4e67-abba-7217a8778e6d.jpg",
filetype: "image/jpg"
}
];
RNFS.uploadFiles({
toUrl: CLOUDINARY_URL,
files: files,
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded"
},
begin: uploadBegin,
progress: uploadProgress
})
.promise.then(response => {
if (response.statusCode == 200) {
console.log("FILES UPLOADED!"); // response.statusCode, response.headers, response.body
} else {
console.log("SERVER ERROR");
}
})
.catch(err => {
if (err.description === "cancelled") {
// cancelled by user
}
console.log(err);
});
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.