File does not save in download folder

Please provide the following:

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): Android

I wanted to export the JSON data object to csv file and save it in download folder but I not sure where the file saved at or whether it has been saved or not. When i check the path it was written file:///data/user/0/host.exp.exponent/files/ExperienceData/UNVERIFIED- and when i check the FileSystem.writeAsStringAsync(path,csv,{ encoding: FileSystem.EncodingType.UTF8 }) it returns as

Promise { “_U”: 0, “_V”: 1, “_W”: null, “_X”: null, }

        var data = this.state.results
        var headers = 'Transaction ID, Title, Amount, Category, Note, Date'
        var csv = `${headers}${data}`;
        var path = FileSystem.documentDirectory+"test.csv";
        var { status } = await MediaLibrary.requestPermissionsAsync();
        console.log("status:", status)
        if (status === "granted") {
       FileSystem.writeAsStringAsync(path,csv,{ encoding: FileSystem.EncodingType.UTF8 })
       var asset = await MediaLibrary.createAssetAsync(path)
       await MediaLibrary.createAlbumAsync("Download", asset, false)
            console.log(`wrote file ${path}`);

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.