uploadToBlobStorage()v4.0.425
Uploads a file from the sandbox to Vercel Blob storage. Typically used after renderVideoOnVercel() or renderStillOnVercel() to make the output publicly accessible.
Example
const {url , size } = await uploadToBlobStorage ({
sandbox ,
sandboxFilePath : '/tmp/video.mp4',
contentType : 'video/mp4',
blobToken : process .env .BLOB_READ_WRITE_TOKEN !,
});
console .log (`Uploaded ${size } bytes to ${url }`);Arguments
An object with the following properties:
sandbox
A VercelSandbox instance.
sandboxFilePath
The path to the file inside the sandbox to upload, e.g. "/tmp/video.mp4".
blobPath?
The destination path in Vercel Blob, e.g. "renders/abc.mp4". If omitted, a random path is generated.
contentType
The MIME type of the file, e.g. "video/mp4" or "image/png".
blobToken
Your Vercel Blob read/write token. Typically process.env.BLOB_READ_WRITE_TOKEN.
Return value
An object containing:
url
The public download URL of the uploaded file.
size
The size of the uploaded file in bytes.