Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

192
Views
File does not save in download folder

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-192.168.1.14-csvproject/test.csv 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, }

CSV=async()=>{
        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}`);
            
        }
       
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You didn't use await and it return promise object instead of promise response

await FileSystem.writeAsStringAsync(path,csv,{ encoding: FileSystem.EncodingType.UTF8 })

and then when you are execute CSV fn

await CVS();
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!