Spring Boot Web MVC : JSP Form File Upload

Опубликовано: 09 Март 2025
на канале: Xavier Dupont
232
0

Jump to 0:30, this was the time it took for the live video to be visible on my phone.



The main gotcha is to forget that forms default to application/x-www-form-urlencoded and the file uploads require multipart/form-data. Then later, the other gotcha is to forget that there is a maximum limit on the size of the upload but this limit is configurable. Last gotcha is to forget that the whole content of the file is transmitted at once, which will not work for too large files, it will eat up in memory, at least in this example.
Here we do not store the uploaded file anywhere. This is the topic for another thing. You could save it locally of course or send it to S3, or in some kind of database.

Link to demo project: https://github.com/xavierdpt/springbo...