我已经编写了一个jsp页面,用于使用POST方法上传图像,com.oreilly.servlet.multipart.MultipartParser
实际使用文件成功上传并且发布值也正确但它抛出异常
java.io.IOException: Posted content type isn't multipart/form-data
MultipartParser mp = null;
try{
mp = new MultipartParser(request, 1*1024*1024); // 10MB
}
catch(Exception e){
out.println("Exception1:"+e);
}
while ((part = mp.readNextPart()) != null) {
name = part.getName();
if (part.isParam()) {
ParamPart paramPart = (ParamPart) part;
value = paramPart.getStringValue();
if(name.equals("companyname") && value != null){
}
if(name.equals("version") && value != null && name != null){
}
}
else if (part.isFile()) {
String getimagelogovalue="";
FilePart filePart = (FilePart) part;
String fileName = filePart.getFileName();
if (fileName != null) {
}
else {}
out.flush();
}
}