Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
a179346 committed Feb 28, 2024
1 parent f7e1e61 commit 2691518
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export function UploadForm() {
const handleFormAction = (formData: FormData) => {
const file = formData.get("file") as File;
if (!file) return;

const uploader = new ChunkUploader({
file,
onChunkUpload: chunkUploadAction,
Expand All @@ -63,6 +64,7 @@ export function UploadForm() {
console.log("Upload complete");
},
});

uploader.start();
};

Expand Down Expand Up @@ -112,6 +114,7 @@ export async function chunkUploadAction(
start: offset,
}
);

return new Promise<void>((resolve, reject) => {
writeable.on("finish", () => resolve());
writeable.on("error", reject);
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-chunk-upload-action",
"version": "1.1.0",
"version": "1.2.0",
"description": "Uploading large files with chunking using server action in Next.js",
"main": "dist/index.js",
"scripts": {
Expand Down

0 comments on commit 2691518

Please sign in to comment.