I am using supabase as my storage, and i am making a request to get the response as CSV, as follows:
const exportColetasAsCSV = async ( IDs: number[] ) => {
const {data, error} = await supabase
.from('coletas')
.select()
.in('id', IDs)
.csv();
if (error) console.log('Erro exportColetasAsCSV:', error);
return data;
}
And i want to share it using expo-sharing (https://docs.expo.dev/versions/latest/sdk/sharing/), but to do that i need to have it as a local file, so i'm trying to save it locally with File-System (https://docs.expo.dev/versions/latest/sdk/filesystem/), but to save it locally i only see examples using http uri, like this:
FileSystem.downloadAsync(
'http://techslides.com/demos/sample-videos/small.mp4',
FileSystem.documentDirectory + 'small.mp4'
)
.then(({ uri }) => {
Alert.alert(
"App",
uri
);
})
Can i save it as a CSV like the one i receive as a response from supabase? If so, how?