I wrote some lines in application.yml to solve this issue like:
spring:
http:
multipart:
max-file-size: 10MB
max-request-size: 10MB
but it didn't solve the problem. However, adding same lines in application.properties after formatting to single liner way i.e. properties file way then it worked.