-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(blob): Provide onUploadProgress({ loaded, total, percentage }) (#…
…782) * feat(blob): Provide onUploadProgress({ loaded, total, percentage }) This commit introduces an `onUploadProgress` callback to put/upload*. Here's how to use it: ```ts // also works with upload() const blob = await put('file.pdf', file, { onUploadProgress(event) { console.log(event.loaded, event.total, event.percentage); } }); ```
- Loading branch information
Showing
34 changed files
with
2,432 additions
and
895 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
'@vercel/blob': minor | ||
'vercel-storage-integration-test-suite': minor | ||
--- | ||
|
||
Add onUploadProgress feature to put/upload | ||
|
||
You can now track the upload progress in Node.js and all major browsers when | ||
using put/upload in multipart, non-multipart and client upload modes. Basically | ||
anywhere in our API you can upload a file, then you can follow the upload | ||
progress. | ||
|
||
Here's a basic usage example: | ||
|
||
``` | ||
const blob = await put('big-file.pdf', file, { | ||
access: 'public', | ||
onUploadProgress(event) { | ||
console.log(event.loaded, event.total, event.percentage); | ||
} | ||
}); | ||
``` | ||
|
||
Fixes #543 | ||
Fixes #642 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.