Skip to content

armgit / papra

Public Imported from GitHub
0

The minimalistic document archiving platform.

fix(upload): disable client size guard when maxUploadSize <= 0 (#501)

Corentin Thomassetb5bf0cca4b57
diff --git a/.changeset/proud-cloths-glow.md b/.changeset/proud-cloths-glow.md
new file mode 100644
index 00000000..a0e54d90
--- /dev/null
+++ b/.changeset/proud-cloths-glow.md
@@ -0,0 +1,5 @@
+---
+"@papra/app-client": patch
+---
+
+Fix an issue preventing to disable the max upload size
diff --git a/apps/papra-client/src/modules/documents/components/document-import-status.component.tsx b/apps/papra-client/src/modules/documents/components/document-import-status.component.tsx
index 7d6df575..76f5932b 100644
--- a/apps/papra-client/src/modules/documents/components/document-import-status.component.tsx
+++ b/apps/papra-client/src/modules/documents/components/document-import-status.component.tsx
@@ -72,9 +72,10 @@ export const DocumentUploadProvider: ParentComponent = (props) => {
setState('open');
await Promise.all(files.map(async (file) => {
+ const { maxUploadSize } = config.documentsStorage;
updateTaskStatus({ file, status: 'uploading' });
- if (file.size > config.documentsStorage.maxUploadSize) {
+ if (maxUploadSize > 0 && file.size > maxUploadSize) {
updateTaskStatus({ file, status: 'error', error: Object.assign(new Error('File too large'), { code: 'document.size_too_large' }) });
return;
}