Where to find expo filesystem file

Please provide the following:

  1. SDK Version: 41
  2. Platforms(Android/iOS/web/all): Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

Hi, I’m still new to this so please correct me if I’m wrong. I was trying to get the json object from database then write it into csv file but I not sure if I’m doing it correctly because it doesn’t show where the file has saved to and I couldn’t find it. When I try to use readAsStringAsync() it says [Unhandled promise rejection: Error: No resource found with the name test123.csv] Please help me out thanks in advance.

        var data = this.state.results
        var headers = 'Transaction ID, Title, Amount, Category, Note, Date'
        var csv = `${headers}${data}`;
        const dir = FileSystem.documentDirectory + 'Expense Report/';
        const path = dir + 'test123.csv';
        await FileSystem.makeDirectoryAsync(dir, { intermediates: true });
        console.log('directory check ok, writing...');
       await FileSystem.writeAsStringAsync(path,csv,{ encoding: FileSystem.EncodingType.UTF8 })
        await FileSystem.readAsStringAsync('test123.csv')
            console.log(`wrote file ${path}`);

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