I know this is extremely late to the game, but I wanted to post the additional issue I faced when using mysql, if anyone faces the same issue in future.
As some of the answers mentioned above, setting these in the application.properties will mostly fix the problem
spring.http.multipart.max-file-size=16MB
spring.http.multipart.max-request-size=16MB
I am setting it to 16 MB, because I am using mysql MEDIUMBLOB datatype to store the file.
But after fixing the application.properties, When uploading a file > 4MB gave the error: org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [insert into test_doc(doc_id, duration_of_doc, doc_version_id, file_name, doc) values (?, ?, ?, ?, ?)]; Packet for query is too large (6656781 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.; nested exception is com.mysql.jdbc.PacketTooBigException: Packet for query is too large (6656781 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
So I ran this command from mysql:
SET GLOBAL max_allowed_packet = 1024*1024*16;