file uploaded but not display on server
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); });