Skip to main content

upload()

Uploads a file to an existing bucket.

// from client
const file = event.target.files[0];
const { data, error } = await kontenbase.storage.upload(file);
// from server
const file = req.files[0];
const { data, error } = await kontenbase.storage.upload(
file.buffer,
file.originalname,
);

Response

NameTypeDescription
res.dataobjectResponse for data
res.statusnumberResponse for status code
res.statusTextstringResponse for status message
res.errorobjectResponse for error occurred
note
  • Default bucket used is Kontenbase project id