You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/operate/customize/file-uploads/upload_limits.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,15 +15,54 @@ However, the total size of all files deposited with a single record cannot excee
15
15
16
16
**Note** that the Flask configuration option `MAX_CONTENT_LENGTH` is only applied for multi-part form uploads (e.g. community logos), but not for the files deposited with records.
17
17
18
-
For the InvenioRDM deposit form, restrictions are available for the total number of files and total file size (in decimal bytes). These are set by the `APP_RDM_DEPOSIT_FORM_QUOTA` variable which can be configured in `invenio.cfg`. For example, if you want to restrict users to a maximum upload of 30 GB and 100 files, you would add:
19
18
20
-
```
19
+
## Limiting File Uploads
20
+
21
+
Limiting the maximum size for file uploads and number of files is critical to avoid abuse (e.g., filling up storage or uploading too many files). InvenioRDM already ships with sensible limits (10 GB per file and 10 GB total per bucket) that work for most deployments. Adjust these if your use case requires stricter or looser limits.
22
+
23
+
### Configuration
24
+
25
+
#### Frontend (Deposit Form)
26
+
Controls how much the user interface allows users to upload which can be configured in `invenio.cfg`:
27
+
28
+
```py
21
29
APP_RDM_DEPOSIT_FORM_QUOTA= {
22
30
"maxFiles": 100,
23
31
"maxStorage": 30*10**9,
24
32
}
25
33
```
26
34
35
+
#### Backend (File Storage & Record Quotas)
36
+
37
+
Controls enforcement at the storage and API level:
38
+
39
+
```py
40
+
# Regular record files
41
+
RDM_FILES_DEFAULT_QUOTA_SIZE=30*10**9
42
+
"""Max total storage per record 30 GB"""
43
+
44
+
RDM_FILES_DEFAULT_MAX_FILE_SIZE=10*10**9
45
+
"""Max size per file 10 GB"""
46
+
47
+
# Files REST layer (bucket quota)
48
+
FILES_REST_DEFAULT_QUOTA_SIZE=30*10**9
49
+
"""Bucket total storage 30 GB"""
50
+
51
+
FILES_REST_DEFAULT_MAX_FILE_SIZE=10*10**9
52
+
"""Bucket max file size 10 GB"""
53
+
```
54
+
55
+
### Quota lookup priority
56
+
57
+
For new record depositions, the quota enforcement follows this priority:
58
+
59
+
1. User-specific quota – If a quota is set for a given user, it takes precedence over all other limits.
60
+
2.`RDM_FILES_DEFAULT_QUOTA_SIZE` – If no user quota, the default record quota is applied.
61
+
3.`FILES_REST_DEFAULT_QUOTA_SIZE` – If the record quota is not set, the bucket quota acts as a fallback.
62
+
4.`APP_RDM_DEPOSIT_FORM_QUOTA` – Only enforced by the frontend to prevent users from exceeding limits during upload while using the deposition form.
63
+
64
+
For existing drafts, the quota applied is the one that was active when the draft record was created. Updating configs won't retroactively apply.
65
+
27
66
## Nginx
28
67
29
68
While the above mentioned configuration would already prevent the backend from accepting files that are too large, an additional layer of defense can be added by configuring `nginx` to reject client requests above a certain size.
0 commit comments