diff --git a/next.config.js b/next.config.js
index 685b0b2..65ae78c 100644
--- a/next.config.js
+++ b/next.config.js
@@ -7,6 +7,18 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
+
+ // Increase body size limit for file uploads.
+ experimental: {
+ serverComponentsExternalPackages: [],
+ },
+
+ // Configure API routes to handle larger file uploads
+ api: {
+ bodyParser: {
+ sizeLimit: '100mb',
+ },
+ },
// https://github.com/privateOmega/html-to-docx/issues/129
webpack: (config) => {
diff --git a/src/app/api/submit-material/route.ts b/src/app/api/submit-material/route.ts
index 882e238..6c57c46 100644
--- a/src/app/api/submit-material/route.ts
+++ b/src/app/api/submit-material/route.ts
@@ -20,6 +20,15 @@ const getLectureData = (formData: FormData) => {
return lectures
}
+// Configure body size limit for this API route
+export const config = {
+ api: {
+ bodyParser: {
+ sizeLimit: '100mb',
+ },
+ },
+}
+
// See documentation in /docs/zenodo/design.md
export async function POST(
req: NextRequest,
diff --git a/src/pages/submit-material/index.tsx b/src/pages/submit-material/index.tsx
index 077e875..355ee89 100644
--- a/src/pages/submit-material/index.tsx
+++ b/src/pages/submit-material/index.tsx
@@ -159,6 +159,9 @@ export default function SubmitMaterial({ pageCopy }: SubmitMaterialProps) {
{lectures.map((lecture, index) => {
@@ -182,6 +185,9 @@ export default function SubmitMaterial({ pageCopy }: SubmitMaterialProps) {