Skip to content

Commit 9392078

Browse files
mirekystmorrell
authored andcommitted
docs: enhance file upload limits documentation
Updated the documentation for limiting file uploads to clarify frontend and backend configurations.
1 parent b398bdc commit 9392078

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

docs/operate/customize/file-uploads/upload_limits.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,54 @@ However, the total size of all files deposited with a single record cannot excee
1515

1616
**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.
1717

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:
1918

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
2129
APP_RDM_DEPOSIT_FORM_QUOTA = {
2230
"maxFiles": 100,
2331
"maxStorage": 30*10**9,
2432
}
2533
```
2634

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+
2766
## Nginx
2867

2968
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

Comments
 (0)