Geting HTTP Status 400 - Required MultipartFile parameter 'file' is not present in spring

后端 未结 3 383
小蘑菇
小蘑菇 2021-01-12 14:14

I am trying to upload a file using spring. Below is my code how I am working on it but if I try to use it I am getting this response:

HTTP

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-12 14:41

    Spring needs the

    bean to handle file-uploads.

    You should register this bean in your application context file.

    The Content-Type should also be valid. In your case enctype="multipart/form-data"

    EDIT1:

    You can give the upload and memory size to the bean properties:

      
            
             
    
            
             
    
        
    

提交回复
热议问题