itinance / itinance/react-native-fs

file uploaded but not display on server

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

Description

I'm using react-native-fs 2.18.0
react-native 0.66.3
I'm trying to upload a simple text file using API from my DocumentdirectoryPath, whole process is completed and even I get the status code 200
but the uploaded text file is not available on server.
`RNFS.uploadFiles({
toUrl: fileUploadURL,
files: fileToUpload,
method: 'POST',
headers: {
'Accept': 'application/json',
},
begin: uploadBegin,
progress: uploadProgress
}).promise.then((response) => {
if (response.statusCode == 200) {
console.log(JSON.stringify(response));
console.log('FILES UPLOADED!'); // response.statusCode, response.headers, response.body
Toast.show({ type: 'success', position: 'bottom', text1: 'Configurations uploaded.', visibilityTime: 2000, autoHide: true, topOffset: 30, bottomOffset: 40 });
} else {
// console.log('SERVER ERROR');
Toast.show({ type: 'error', position: 'bottom', text1: 'Something went wrong.', visibilityTime: 2000, autoHide: true, topOffset: 30, bottomOffset: 40 });
}
})
.catch((err) => {
if (err.description === "cancelled") {
// cancelled by user
console.log("*****Process cancelled by user******");
}
console.log(err);
});`

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.