File upload in Spring MVC: receive, check, store and serve files safely
multipart/form-data and MultipartFile, size limits, where to store files (disk, database, object storage), five bugs in the common way of saving uploads, a FileStorageService that checks magic bytes and blocks path traversal, and serving files without opening an XSS hole.