feat(upload): bump per-file cap to 200MB end-to-end
Cluster: Appwrite container _APP_STORAGE_LIMIT 30000000 → 209715200 (200MB) in /root/services/appwrite/.env on kovaksoft-coolify, then docker compose up -d to roll the worker pool with the new value. Backup of the .env left at .env.bak.<date>. Bucket: job-files maximumFileSize updated to 209715200 via Appwrite MCP (storage_update_bucket). App: MAX_FILE_BYTES in both the upload API route and the original server action raised to 200MB. Client-side panel guard relaxed accordingly — one large file is now allowed to fill the entire batch (the 200MB proxy/serverActions cap is the bottleneck, not the per-file rule). Error copy updated. isletmem and any other tenants on the cluster also get the new limit, which is the desired behaviour — old 30MB ceiling was a relic of an Appwrite default that no DLS workflow can actually live with.
This commit is contained in:
@@ -61,8 +61,8 @@ export function JobFilesPanel({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const MAX_FILE_BYTES = 30 * 1024 * 1024;
|
const MAX_FILE_BYTES = 200 * 1024 * 1024;
|
||||||
const MAX_BATCH_BYTES = 180 * 1024 * 1024; // headroom under the 200MB proxy cap
|
const MAX_BATCH_BYTES = 200 * 1024 * 1024; // proxy cap; one large file fills the whole batch
|
||||||
|
|
||||||
function UploadForm({ jobId }: { jobId: string }) {
|
function UploadForm({ jobId }: { jobId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -166,11 +166,11 @@ function UploadForm({ jobId }: { jobId: string }) {
|
|||||||
{selected.length > 0 ? (
|
{selected.length > 0 ? (
|
||||||
overSize ? (
|
overSize ? (
|
||||||
<span className="text-destructive">
|
<span className="text-destructive">
|
||||||
{overSize.name} 30MB'tan büyük (her dosya maksimum 30MB).
|
{overSize.name} 200MB'tan büyük (her dosya maksimum 200MB).
|
||||||
</span>
|
</span>
|
||||||
) : overBatch ? (
|
) : overBatch ? (
|
||||||
<span className="text-destructive">
|
<span className="text-destructive">
|
||||||
Toplam {formatSize(totalBytes)} — 180MB sınırını aşıyor. Daha az dosya seçin.
|
Toplam {formatSize(totalBytes)} — 200MB sınırını aşıyor. Daha az dosya seçin.
|
||||||
</span>
|
</span>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@@ -178,7 +178,7 @@ function UploadForm({ jobId }: { jobId: string }) {
|
|||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
"Tarama (STL/OBJ), görsel veya PDF — max 30MB / dosya, batch 180MB"
|
"Tarama (STL/OBJ), görsel veya PDF — max 200MB / dosya"
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
{uploading ? (
|
{uploading ? (
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
import { createAdminClient } from "@/lib/appwrite/server";
|
import { createAdminClient } from "@/lib/appwrite/server";
|
||||||
import { requireRole, requireTenant } from "@/lib/appwrite/tenant-guard";
|
import { requireRole, requireTenant } from "@/lib/appwrite/tenant-guard";
|
||||||
|
|
||||||
const MAX_FILE_BYTES = 30 * 1024 * 1024;
|
const MAX_FILE_BYTES = 200 * 1024 * 1024;
|
||||||
|
|
||||||
function classifyFile(mimeType: string | undefined, name: string): JobFileKind {
|
function classifyFile(mimeType: string | undefined, name: string): JobFileKind {
|
||||||
const lower = (mimeType || name).toLowerCase();
|
const lower = (mimeType || name).toLowerCase();
|
||||||
@@ -100,7 +100,7 @@ export async function POST(
|
|||||||
for (const f of files) {
|
for (const f of files) {
|
||||||
if (f.size > MAX_FILE_BYTES) {
|
if (f.size > MAX_FILE_BYTES) {
|
||||||
return NextResponse.json(
|
return NextResponse.json(
|
||||||
{ ok: false, error: `${f.name} 30MB sınırını aşıyor.` },
|
{ ok: false, error: `${f.name} 200MB sınırını aşıyor.` },
|
||||||
{ status: 400 },
|
{ status: 400 },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import type {
|
|||||||
JobFileUploadState,
|
JobFileUploadState,
|
||||||
} from "./job-file-types";
|
} from "./job-file-types";
|
||||||
|
|
||||||
const MAX_FILE_BYTES = 30 * 1024 * 1024; // 30MB — bucket limit
|
const MAX_FILE_BYTES = 200 * 1024 * 1024; // 200MB — bucket limit
|
||||||
|
|
||||||
function appwriteError(e: unknown, fallback = "Beklenmeyen bir hata oluştu."): string {
|
function appwriteError(e: unknown, fallback = "Beklenmeyen bir hata oluştu."): string {
|
||||||
if (e instanceof AppwriteException) return e.message || fallback;
|
if (e instanceof AppwriteException) return e.message || fallback;
|
||||||
@@ -89,7 +89,7 @@ export async function uploadJobFilesAction(
|
|||||||
|
|
||||||
for (const f of files) {
|
for (const f of files) {
|
||||||
if (f.size > MAX_FILE_BYTES) {
|
if (f.size > MAX_FILE_BYTES) {
|
||||||
return { ok: false, error: `${f.name} 30MB sınırını aşıyor.` };
|
return { ok: false, error: `${f.name} 200MB sınırını aşıyor.` };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user