Releases: vercel/storage
@vercel/[email protected]
Minor Changes
- 52c2fe2: feat(blob): add rate limited error
@vercel/[email protected]
Minor Changes
-
8e278f2: # feat(blob): add advanced multipart upload methods
This exposes the three different multipart steps as functions of the SDK. Before this change every multipart upload was uncontrolled, meaning the full data was passed to the SDK and the SDK took care of chunking and uploading.
Now it's possible to manually upload chunks and start and complete the multipart upload. All of the new functions can be used both on the server and the browser. There are two different API's that can be used.
All parts uploaded must be at least 5MB in size, except for the last part. The last part can be smaller than 5MB. If you have a single part, it can be any size. All parts must be the same size, except for the last part.
Individual methods
Use
createMultipartUpload
,uploadPart
andcompleteMultipartUpload
to manage the upload.const { key, uploadId } = await vercelBlob.createMultipartUpload( 'big-file.txt', { access: 'public' }, ); const part1 = await vercelBlob.uploadPart(fullPath, 'first part', { access: 'public', key, uploadId, partNumber: 1, }); const part2 = await vercelBlob.uploadPart(fullPath, 'second part', { access: 'public', key, uploadId, partNumber: 2, }); const blob = await vercelBlob.completeMultipartUpload( fullPath, [part1, part2], { access: 'public', key, uploadId, }, );
Multipart uploader
For multipart methods, since some of the data remains consistent (uploadId, key), you can make use of the
createMultipartUploader
. This function stores certain data internally, making it possible to offer convinientput
andcomplete
functions.const uploader = await vercelBlob.createMultipartUploader('big-file.txt', { access: 'public', }); const part1 = await uploader.uploadPart(1, createReadStream(fullPath)); const part2 = await uploader.uploadPart(2, createReadStream(fullPath)); const blob = await uploader.complete([part1, part2]);
Patch Changes
- 2ecc0e2: fix(blob): remove multipart boolean from copy options
@vercel/[email protected]
Minor Changes
-
5d71dda: # feat(blob): add
downloadUrl
andgetDownloadUrl
Adds a new blob property called
downloadUrl
. This URL will have thecontent-disposition
set toattachment
meaning it will force browsers to start a download instead of showing a preview. This URL can be used to implement download links. In addition to this new field the sdk is also exposing a new util function calledgetDownloadUrl
which can also be used to derive a download URL from a blob URL.
@vercel/[email protected]
Patch Changes
- 5d84a4a: chore(deps): update dependency kysely to v0.27.2
@vercel/[email protected]
Patch Changes
- 5d84a4a: chore(deps): update dependency kysely to v0.27.2
- Updated dependencies [5d84a4a]
- @vercel/[email protected]
@vercel/[email protected]
Patch Changes
- abfdf65: fix(deps): update dependency @neondatabase/serverless to v0.7.2
@vercel/[email protected]
Patch Changes
- abfdf65: fix(deps): update dependency @neondatabase/serverless to v0.7.2
- Updated dependencies [abfdf65]
- @vercel/[email protected]
@vercel/[email protected]
Minor Changes
-
d44bd3b: feat(blob): add retry to all blob requests
This change generalizes the way we request the internal Blob API. This moves api version, authorization, response validation and error handling all into one place.
Also this adds a retry mechanism to the API requests
@vercel/[email protected]
Minor Changes
- f70264e: Correct VercelPostgresDialect to return an adapter that reports that transactions are not supported
@vercel/[email protected]
Minor Changes
-
dc7ba0e: feat(blob): allow inline content disposition for certain blobs
Once you use this new version, then most common medias won't be automatically
downloading but rather will display the content inline.Already uploaded files will not change their behavior.
You can reupload them if you want to change their behavior.Fixes #509