Upload an object

upload some data

The upload operation is an upsert: it creates the object if it does not exist, or override the object if it already exists.

When we build the object's reference, we may make the name unique to prevent an unintended override.

The browser SDK upload method accepts different kind of binary data: a Blob or a File object.

We provide the reference and the data to uploadBytes().

uploadBytes(fileRef, file).then((snapshot) => {})

upload's result

On success, we receive the object's metadata and reference, in a UploadResult object.

const result = await uploadBytes(fileRef, file)

result.metadata
result.ref
earlymorning logo

© 2025 - All rights reserved

Upload an object

upload some data

The upload operation is an upsert: it creates the object if it does not exist, or override the object if it already exists.

When we build the object's reference, we may make the name unique to prevent an unintended override.

The browser SDK upload method accepts different kind of binary data: a Blob or a File object.

We provide the reference and the data to uploadBytes().

uploadBytes(fileRef, file).then((snapshot) => {})

upload's result

On success, we receive the object's metadata and reference, in a UploadResult object.

const result = await uploadBytes(fileRef, file)

result.metadata
result.ref