Skip to main content

upload()

Use nhost.storage.upload to upload a file. The file must be of type File.

If no bucket is specified the default bucket will be used.

await nhost.storage.upload({ file })

Parameters


params required StorageUploadParams

PropertyTypeRequiredNotes
params.fileFile✔️
params.bucketIdstring
params.namestring
params.idstring

Examples

await nhost.storage.upload({ file })
await nhost.storage.upload({ file, bucketId: '<Bucket-ID>' })