Kein Upload-Größenlimit — RAM/Disk-Erschöpfung möglich #5

Closed
opened 2026-04-23 14:14:18 +02:00 by ferdi2go · 1 comment
Owner

Problem\n\nserver.py:136await file.read() liest die komplette Datei in den Arbeitsspeicher. Eine 500 MB RAW-Datei führt zu Speicherproblemen.\n\n## Fix\n\nMaximale Dateigröße per Upload begrenzen (z.B. 50 MB):\npython\nMAX_FILE_SIZE = 50 * 1024 * 1024 # 50 MB\nraw = await file.read(MAX_FILE_SIZE + 1)\nif len(raw) > MAX_FILE_SIZE:\n continue # oder HTTPException\n

## Problem\n\n`server.py:136` — `await file.read()` liest die komplette Datei in den Arbeitsspeicher. Eine 500 MB RAW-Datei führt zu Speicherproblemen.\n\n## Fix\n\nMaximale Dateigröße per Upload begrenzen (z.B. 50 MB):\n```python\nMAX_FILE_SIZE = 50 * 1024 * 1024 # 50 MB\nraw = await file.read(MAX_FILE_SIZE + 1)\nif len(raw) > MAX_FILE_SIZE:\n continue # oder HTTPException\n```
ferdi2go added the priority: mediummaintenance labels 2026-04-23 14:14:18 +02:00
Author
Owner

Fixed in commit 69adfe6.

Fixed in commit `69adfe6`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ferdi2go/OnlyFrames#5