title: Saving a files in React-Native using react-native-fs
body: <p>After writing data to a file using react-native-fs where does the file go? </p>
  
  <p>I am able to write the file and view it when i am testing in my local machine using <code>ExternalStorageDirectoryPath</code> in android But when i push my app to play store I am unable to perform the write operation. 
  Same thing is happening while using <code>DocumentDirectoryPath</code> in IOS</p>
  
  <p>I can find the file in emulator and external device when i run <code>react-native-run-android</code> but not when i published the app. </p>
  
  <p>Reference: <a href="https://stackoverflow.com/questions/54840085/saving-a-files-in-react-native-using-reart-native-fs">Saving a files in React-Native using reart-native-fs</a> In this post only files are shown from emulators and i am looking for a solution to find the file in real world devices after installing my app. Thanks</p>
  
  <p>Below is my code </p>
  
  <pre><code>fetch('https://xxxxxxxxxxxx.execute-api.us-east-1.amazonaws.com/prod/export', {
            method: 'post',
            headers:{
              'Accept': 'application/json',
              'Content-type': 'application/json'
            },
            body:JSON.stringify({
              deviceid: item,
              fromtime: myEpoch1.toString(),
              totime: myEpoch2.toString()
            })
          })
          .then((response) =&gt; response.json())
            .then((responseJson) =&gt; {
              console.log(responseJson);
              this.setState({exportButton:false});
              if(responseJson){
                var path = RNFS.ExternalStorageDirectoryPath + '/'+ myEpoch1 +'-to-'+ myEpoch2 +'.json';
                RNFS.writeFile(path, JSON.stringify(responseJson), 'utf8')
                .then((success) =&gt; {
                  console.log('FILE WRITTEN!');
                  Alert.alert(
                    'Sucesss: File saved',
                    'File downloaded and saved successfully to ' + path + ' device' ,
                    [
                      {text: 'Cancel', onPress: () =&gt; console.log('Cancel Pressed'), style: 'cancel'},
                      {text: 'OK', onPress: () =&gt; console.log('OK Pressed')},
                    ],
                    { cancelable: false }
                  )
                })
                .catch((err) =&gt; {
                  console.log(err.message);
                });
              }
            })```
  </code></pre>