data" is not supported to send simple text?

This question already has an answer here:

  • How to upload files to server using JSP/Servlet? 12 answers

  • While using enctype="multipart/form-data" form fields aren't available as parameter of the request, you will always get request.getParameter(name); as null. They are included in the stream. You can use Apache Commons Fileupload to upload file with other form fields data. In order to use Apache Commons FileUpload, you need to have following files in your webapp's /WEB-INF/lib:

    1.) commons-fileupload.jar

    2.) commons-io.jar

    For ex.

    if (item.isFormField()) {
        String name = item.getFieldName();
        String value = item.getString();
    }
    

    Have a look at http://commons.apache.org/proper/commons-fileupload//using.html

    链接地址: http://www.djcxy.com/p/22204.html

    上一篇: 什么是空字节和多部分/形式的后果

    下一篇: 数据“不支持发送简单文本?