-
Notifications
You must be signed in to change notification settings - Fork 380
Open
Description
We want to add a built-in support to Storage service, that would encompass:
- Having a client library to allow file uploads (for browsers)
- Providing a built-in support in steps to quickly download files or create upload urls
- Providing a way to trigger steps when the file is uploaded
Examples: We can create a new file upload and set it to emit to a specific event when the file is uploaded.
Concept
const uploadUrl = await context.storage.createUploadUrl({
path: '/path/to/folder/image.png',
acceptMime: ['image/png']
onUpload: {
emit: 'image-uploaded'
}
})
Concept UI
await motiaClient.storage.upload({
url: uploadUrl,
file: file, // this is a file instance selected from input
onProgress: (percentage) => {
console.log('upload percentage', percentage);
}
});
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Upcoming