fix(file-manager): raise the upload route body limit, add a client-side size guard, and write uploaded content to containers in chunks to avoid oversized SSH commands.

This commit is contained in:
KodekaTeam committed 2026-06-15 22:21:47 +07:00
1 parent ad60be0094
commit 4c957c50b4
3 files changed
+92 -5

No files matched your search

@@ -41,6 +41,8 @@ interface ContainerFileManagerModalProps {
onClose: () => void;
}
const FILE_MANAGER_UPLOAD_MAX_BYTES = 6 * 1024 * 1024;
type PendingConfirmAction = {
title: string;
description: string;
@@ -288,6 +290,16 @@ export default function ContainerFileManagerModal({
const uploadFileObject = useCallback(
async (file: File) => {
if (file.size > FILE_MANAGER_UPLOAD_MAX_BYTES) {
setNotice({
tone: "error",
message: `File is too large. Maximum upload size is ${formatBytes(
FILE_MANAGER_UPLOAD_MAX_BYTES,
)}.`,
});
return;
}
setUploading(true);
setNotice(null);
try {