当FORM的ENCTYPE="multipart/form-data" 时request.getParameter()获取不到值!
百度一下,找到个答案,看不太懂,请高人解释一下:
1. download > http://jakarta.apache.org/commons/sandbox/fileupload/>
2. invoke readHeaders() in > org.apache.commons.fileupload.MultipartStreamThe Solution B as given by my dear friend is a bit hectic and a bit complex :(We can try the following solution which I found much simpler (at least in usage).
1. Download one of the versions of UploadFile from http://jakarta.apache.org/commons/fileupload/
2. Invoke parseRequest(request) on org.apache.commons.fileupload.FileUploadBase which returns list of org.apache.commons.fileupload.FileItem objects.
3. Invoke isFormField() on each of the FileItem objects. This determines whether the file item is a form paramater or stream of uploaded file.
4. Invoke getFieldName() to get parameter name and getString() to get parameter value on FileItem if it's a form parameter. Invoke write(java.io.File) on FileItem to save the uploaded file stream to a file if the FileItem is not a form parameter.
那位高人给解释一下具体怎么做,特别是invoke 什么的 就是汉语我也不太明白,所以请具体点 :)