We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling uploadToSignedUrl() with { upsert: true } is failing to honor the upsert: true option.
uploadToSignedUrl()
{ upsert: true }
upsert: true
Steps to reproduce the behavior, please provide code snippets or a repository:
const { data: signedUrlData, error: signedUrlError } = await supabase .storage .from('auth-only') .createSignedUploadUrl('private/secret.js') if (signedUrlError) { console.error(signedUrlError) } else if (signedUrlData !== null) { const token = signedUrlData.token const fileBody = fs.readFileSync('dist/protected/secret.js') const { data: uploadData, error: uploadError } = await supabase .storage .from('auth-only') .uploadToSignedUrl('private/secret.js', token, fileBody, {upsert: true, contentType: 'text/javascript'}) if (uploadError) { console.error(uploadError) } else { console.log(uploadData) } }
I expect theprivate/secret.js storage object to be replaced.
private/secret.js
Instead, the following error occurs:
StorageApiError: The resource already exists at <anonymous> (/Users/kjh/proj/entel-common.com/node_modules/@supabase/storage-js/dist/main/lib/fetch.js:22:20) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { __isStorageError: true, status: 400 }
Note that replacing the code based on uploadToSignedUrl() with the below code based on update() does work:
update()
const fileBody = fs.readFileSync('dist/protected/secret.js') const { error } = await supabase .storage .from('auth-only') .update('private/secret.js', fileBody, { upsert: true, contentType: 'text/javascript'}) if (error) console.error(`Error:`, error)
Similar unresolved past report in Discord: Problem with createSignedUploadUrl
The text was updated successfully, but these errors were encountered:
Same for me, did anyone find a workaround? I'm currently deleting a file before generating a signed URL
Sorry, something went wrong.
+1
Same here! I don't want to have to delete the file before upload. :(
No branches or pull requests
Bug report
Describe the bug
Calling
uploadToSignedUrl()
with{ upsert: true }
is failing to honor theupsert: true
option.To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Code
Expected behavior
I expect the
private/secret.js
storage object to be replaced.Instead, the following error occurs:
Note that replacing the code based on
uploadToSignedUrl()
with the below code based onupdate()
does work:System information
See Also
Similar unresolved past report in Discord: Problem with createSignedUploadUrl
The text was updated successfully, but these errors were encountered: