有个地方需要在上传文件的同时携带具体的参数,我开始直接拿发现null,
form表单上传文件时候携带参数如何处理这样虽然可以拿到值,但是会导致文件上传失败,可以看看这位大佬的写法

https://blog.csdn.net/ystyaoshengting/article/details/45965981

if (item.isFormField()) {
//如果是普通表单字段
String name = item.getFieldName();
String value = item.getString();

} else {
//如果是文件字段
String fieldName = item.getFieldName();
String fileName = item.getName();
String contentType = item.getContentType();
boolean isInMemory = item.isInMemory();
long sizeInBytes = item.getSize();

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-11-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-01-01
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案