itinance / itinance/react-native-fs
File not created with react-native-fs
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Hello everyone im trying to save a file into my device but im having some problem with react-native-fs library. What im trying to do is create a xlsx excel file on my phone using this code
var data = [
{"name":"John", "city": "Seattle"},
{"name":"Mike", "city": "Los Angeles"},
{"name":"Zach", "city": "New York"}
];
var ws = XLSX.utils.json_to_sheet(data);
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb,ws,"Prova");
const wbout = XLSX.write(wb, {type:'binary', bookType:"xlsx"});
var RNFS = require('react-native-fs');
var file = RNFS.ExternalStorageDirectoryPath + '/test.xlsx';
writeFile(file, wbout, 'ascii').then((r)=>{/* :) */}).catch((e)=>{/* :( */});
This code dont generate any type of error but at the end the file is not created on my device. I already tried the simple example here https://github.com/itinance/react-native-fs but it doesnt work. I dont undestand what im missing, maybe is something with the file path but i dont really undestand. Thx for the help
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.