From 6caa768fc01e15e1af23b136aaf4054d818a84a9 Mon Sep 17 00:00:00 2001 From: ido Date: Fri, 26 Jul 2024 17:24:38 +0300 Subject: [PATCH] fix(bigFile): connecting chunks --- examples/simple-form/src/middleware.ts | 2 +- packages/forms/src/components/form/UploadBigFile/BigFile.ts | 2 +- .../src/components/form/UploadBigFile/uploadBigFileServer.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple-form/src/middleware.ts b/examples/simple-form/src/middleware.ts index 374f48c..9503ad5 100644 --- a/examples/simple-form/src/middleware.ts +++ b/examples/simple-form/src/middleware.ts @@ -5,7 +5,7 @@ export const onRequest = sequence(astroForms({ forms: { bigFilesUpload: { bigFileServerOptions: { - maxUploadSize: 1024 * 1024 // 1MB + maxUploadSize: 1024 * 1024 * 1024, // 1GB } } } diff --git a/packages/forms/src/components/form/UploadBigFile/BigFile.ts b/packages/forms/src/components/form/UploadBigFile/BigFile.ts index a0a06e6..dd29a36 100644 --- a/packages/forms/src/components/form/UploadBigFile/BigFile.ts +++ b/packages/forms/src/components/form/UploadBigFile/BigFile.ts @@ -1,5 +1,5 @@ import { createReadStream } from "fs"; -import { CreateReadStreamOptions, stat, copyFile } from "fs/promises"; +import { type CreateReadStreamOptions, stat, copyFile } from "fs/promises"; export class BigFile { /** diff --git a/packages/forms/src/components/form/UploadBigFile/uploadBigFileServer.ts b/packages/forms/src/components/form/UploadBigFile/uploadBigFileServer.ts index 99ae165..49cf1a3 100644 --- a/packages/forms/src/components/form/UploadBigFile/uploadBigFileServer.ts +++ b/packages/forms/src/components/form/UploadBigFile/uploadBigFileServer.ts @@ -117,8 +117,8 @@ export async function loadUploadFiles(astro: AstroGlobal, options: Partial { inputStream.on("data", (chunk) => {