我尝试通过这种方式创建CommonsMultipartFile实例,但发生了java.lang.NullPointerException。
DiskFileItemFactory factory = new DiskFileItemFactory(1024*1024,null);
FileItem fileitem = factory.createItem("file", "application/vnd.ms-excel;charset=utf-8", true, "d:\\a.xls");//Method threw 'java.lang.NullPointerException' exception. Cannot evaluate org.apache.commons.fileupload.disk.DiskFileItem.toString()
CommonsMultipartFile commonFile=new CommonsMultipartFile(fileitem);
答案 0 :(得分:0)
您无法将Host 10.10.10.15
StrictHostKeyChecking no
作为第二个参数传递给构造函数。
传递某种临时文件夹,如下所示:
null