From f72b7ebdb7d3b7e91827dfa41dc03037c9845570 Mon Sep 17 00:00:00 2001 From: isafulf <51974293+isafulf@users.noreply.github.com> Date: Sun, 2 Apr 2023 17:28:52 -0700 Subject: [PATCH] address https://github.com/openai/openai-cookbook/issues/248 --- apps/file-q-and-a/nextjs/src/pages/api/process-file.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/file-q-and-a/nextjs/src/pages/api/process-file.ts b/apps/file-q-and-a/nextjs/src/pages/api/process-file.ts index 72c9f366..2d874d52 100644 --- a/apps/file-q-and-a/nextjs/src/pages/api/process-file.ts +++ b/apps/file-q-and-a/nextjs/src/pages/api/process-file.ts @@ -27,6 +27,8 @@ export default async function handler( // Create a formidable instance to parse the request as a multipart form const form = new formidable.IncomingForm(); + form.maxFileSize = 30 * 1024 * 1024; // Set the max file size to 30MB + try { const { fields, files } = await new Promise<{ fields: Fields;