fix: raise Files group upload cap 20 MiB -> 2 GiB (api + web)
The Files tab dropzone still enforced the old 20 MiB cap client- and server-side while every other path had moved to 2 GiB. Also corrects the stale '100 MiB' message on the video upload rejection.
This commit is contained in:
parent
ef8d28bc26
commit
613aba236b
4 changed files with 11 additions and 10 deletions
|
|
@ -10,11 +10,12 @@ import type { GroupFile } from "./types";
|
|||
|
||||
/**
|
||||
* Drag-drop + picker for POST /files/groups/:groupId/upload. The API accepts a
|
||||
* single `file` field capped at 20 MiB; the cap is enforced here too so an
|
||||
* single `file` field capped at 2 GiB; the cap is enforced here too so an
|
||||
* oversized pick fails fast with a friendly message instead of a 413.
|
||||
*/
|
||||
|
||||
const MAX_UPLOAD_BYTES = 20 * 1024 * 1024;
|
||||
const MAX_UPLOAD_BYTES = 2 * 1024 * 1024 * 1024;
|
||||
const MAX_LABEL = "2 GiB";
|
||||
|
||||
export function UploadDropzone({ groupId, live, onUploaded }: {
|
||||
groupId: string;
|
||||
|
|
@ -41,8 +42,8 @@ export function UploadDropzone({ groupId, live, onUploaded }: {
|
|||
if (file.size > MAX_UPLOAD_BYTES) {
|
||||
setError(
|
||||
t({
|
||||
en: `${file.name} is ${formatBytes(file.size)} — the limit is 20 MiB.`,
|
||||
es: `${file.name} pesa ${formatBytes(file.size)} — el límite es 20 MiB.`,
|
||||
en: `${file.name} is ${formatBytes(file.size)} — the limit is ${MAX_LABEL}.`,
|
||||
es: `${file.name} pesa ${formatBytes(file.size)} — el límite es ${MAX_LABEL}.`,
|
||||
}),
|
||||
);
|
||||
return;
|
||||
|
|
@ -73,8 +74,8 @@ export function UploadDropzone({ groupId, live, onUploaded }: {
|
|||
: groupId === ""
|
||||
? t({ en: "Choose a group first.", es: "Elige un grupo primero." })
|
||||
: t({
|
||||
en: "Drop a file, paste one, or browse. Up to 20 MiB; stored with re-verified bytes.",
|
||||
es: "Arrastra un archivo, pega uno o búscalo. Hasta 20 MiB; guardado con bytes reverificados.",
|
||||
en: `Drop a file, paste one, or browse. Up to ${MAX_LABEL}; stored with re-verified bytes.`,
|
||||
es: `Arrastra un archivo, pega uno o búscalo. Hasta ${MAX_LABEL}; guardado con bytes reverificados.`,
|
||||
});
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue