Currently, Supabase Storage provides support for generating multiple signed download URLs through:
signObjectUrls(paths, expiresIn)
However, signed upload URLs are currently only supported for a single object through:
signUploadObjectUrl(objectName, url, expiresIn, owner?, options?)
For applications that upload multiple files, developers need to generate signed upload URLs one by one. This results in multiple API calls and makes the Storage API inconsistent with the existing download URL workflow.
Would it make sense to introduce a bulk API:
signUploadObjectUrls(paths, expiresIn, owner?, options?)
similar to:
signObjectUrls(paths, expiresIn)
The method would:
SIGNED_URL_SCOPE_UPLOAD).Example:
const urls = await storage
.from('avatars')
.signUploadObjectUrls([
'user1/avatar.png',
'user2/avatar.png'
], 600)
Possible response:
[
{
"path": "user1/avatar.png",
"signedURL": "/object/upload/sign/avatars/user1/avatar.png?token=..."
},
{
"path": "user2/avatar.png",
"signedURL": "/object/upload/sign/avatars/user2/avatar.png?token=..."
}
]
Many applications support multi-file uploads (images, documents, attachments, etc.). A bulk signed upload URL API would:
I would appreciate feedback from the maintainers/community on whether this API fits the Storage design philosophy and if there are any concerns around permission checks, batching, or response format.
Nafees Madni suggests adding a signUploadObjectUrls() method to Supabase Storage to generate multiple signed upload URLs, similar to the existing method for download URLs. This feature would reduce API calls, improve symmetry between upload and download APIs, and enhance developer experience for applications with multi-file uploads.