title: sending empty files to server React-Native
body: <p>I am trying to send JSON files to Server using NodeJS with multer and i am able to send files but the files are empty.</p>
  
  <p>I am using React-native-File-System to loop through all the files present in the folder </p>
  
  <p>I am not getting any errors and the file upload logs is also showing as UPLOAD COMPLETED but the files are empty</p>
  
  <p>I have tried to send it with form-data but still no luck</p>
  
  <pre><code>        var RNFS = require('react-native-fs');
  
          var path = RNFS.DocumentDirectoryPath + '/toBeSynced';
  
          RNFS.readDir(path)
              .then((success) =&gt; {
                  success.forEach(function (element) {
                      var fileName = element.name
                      var filePath = element.path
                      const options = {
                          url: 'http://192.168.1.15:3333/SurveyJsonFiles/GetFiles',
                          path: filePath,
                          name: fileName,
                          field: 'files',
                          method: 'POST',
                          type: 'multipart',
                          headers: {
                              'content-type': 'multipart/form-data',
                          },
                          //Below are options only supported on Android
                          notification: {
                              enabled: true
                          }
                      }
  
                      Upload.startUpload(options).then((uploadId) =&gt; {
                          console.log('Upload started')
                          Upload.addListener('progress', uploadId, (data) =&gt; {
                              console.log(`Progress: ${data.progress}%`)
                          })
                          Upload.addListener('error', uploadId, (data) =&gt; {
                              console.log(`Error: ${data.error}%`)
                          })
                          Upload.addListener('cancelled', uploadId, (data) =&gt; {
                              console.log(`cancelled: ${data.error}%`)
                          })
                          Upload.addListener('completed', uploadId, (data) =&gt; {
                              // data includes responseCode: number and responseBody: Object
                              console.log('Completed!')
                          })
                      }).catch((err) =&gt; {
                          console.log('Upload error!', err)
                      })
  
  
                  });
              })
              .catch((err) =&gt; {
                  console.log(err.message);
              });
      }
  </code></pre>