upload: suggest checking the proxy for "file too large" error
Massimo Melina committed
Dec 1, 2025 at 12:15 UTC
3ffb9f8aa5e994015d6a561adbf6ea0fb8c63a3a
2 files changed
+3
-1
frontend/src/uploadQueue.ts
+1
-1
@@ -194,7 +194,7 @@ export async function startUpload(toUpload: ToUpload, to: string, resume=0) {
194
195
function error(status: number) {
196
const ERRORS = {
197
- [HTTP_PAYLOAD_TOO_LARGE]: t`file too large`,
197
+ [HTTP_PAYLOAD_TOO_LARGE]: t`file too large` + (getHFS().proxyDetected ? '\n– ' + t('proxy_413', "Check for this limit on the proxy server") : ''),
198
[HTTP_CONFLICT]: t('upload_conflict', "already exists"),
199
[HTTP_INSUFFICIENT_STORAGE]: t`insufficient storage`,
200
}
src/serveGuiFiles.ts
+2
@@ -21,6 +21,7 @@ import { defineConfig, getConfig } from './config'
21
import { getLangData } from './lang'
22
import { dontOverwriteUploading } from './upload'
23
import { customizedIcons, CustomizedIcons } from './icons'
24
+import { getProxyDetected } from './middlewares'
25
26
const size1024 = defineConfig(CFG.size_1024, false, x => formatBytes.k = x ? 1024 : 1000) // we both configure formatBytes, and also provide a compiled version (number instead of boolean)
27
const splitUploads = defineConfig(CFG.split_uploads, 0)
@@ -108,6 +109,7 @@ async function treatIndex(ctx: Koa.Context, filesUri: string, body: string) {
109
plugins,
110
loadScripts: Object.fromEntries(mapPlugins((p, id) => [id, p.frontend_js?.map(f => f.includes('//') ? f : pub + id + '/' + f)])),
111
prefixUrl: ctx.state.revProxyPath,
112
+ proxyDetected: Boolean(getProxyDetected()),
113
dontOverwriteUploading: dontOverwriteUploading.get(),
114
splitUploads: splitUploads.get(),
115
kb: size1024.compiled(),