Skip to content

Instantly share code, notes, and snippets.

@ohss
Last active October 20, 2022 08:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ohss/83b75af5101e2aad56e3c09a913c16c7 to your computer and use it in GitHub Desktop.
Save ohss/83b75af5101e2aad56e3c09a913c16c7 to your computer and use it in GitHub Desktop.
Upload audio file to supabase with expo
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