Skip to content

Add built-in storage support #517

@sergiofilhowz

Description

@sergiofilhowz

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Upcoming

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions