PUT提交表单上传enctype="multipart/form-data"可直接用实例类来接收POST则不可以

//上传接口保存学生信息
@PutMapping("/student/save")
save(Student student){
    student.getName();
    student.getImgFiles();
}

//实体类
Class Student{
    private String name;
    private MultipartFile[] imgFiles;
}


用PupMapping直接可以接收上传的文件和属性

猜你喜欢

转载自blog.csdn.net/hejunfei/article/details/103923508