Last active
October 20, 2022 08:30
-
-
Save ohss/83b75af5101e2aad56e3c09a913c16c7 to your computer and use it in GitHub Desktop.
Upload audio file to supabase with expo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const uri = "path/to/your/file"; | |
const fileExtension = uri.split('.').pop(); | |
const formData = new FormData(); | |
formData.append('audioFile', { | |
uri: uri, | |
type: `audio/x-${fileExtension}`, | |
name: 'name', | |
} as any); | |
const { data: storageData, error: storageError } = await supabase.storage | |
.from('stories') | |
.upload(filename, formData, { contentType: 'multipart/form-data' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment