Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>multipart/form-data</code> encoded requests are indeed not by default supported by the Servlet API prior to version 3.0. The Servlet API parses the parameters by default using <code>application/x-www-form-urlencoded</code> encoding. When using a different encoding, the <code>request.getParameter()</code> calls will all return <code>null</code>. When you're already on Servlet 3.0 (<a href="http://glassfish.dev.java.net" rel="nofollow noreferrer">Glassfish 3</a>, <a href="http://tomcat.apache.org" rel="nofollow noreferrer">Tomcat 7</a>, etc), then you can use <a href="http://java.sun.com/javaee/6/docs/api/javax/servlet/http/HttpServletRequest.html#getParts()" rel="nofollow noreferrer"><code>HttpServletRequest#getParts()</code></a> instead. Also see <a href="http://balusc.blogspot.com/2009/12/uploading-files-in-servlet-30.html" rel="nofollow noreferrer">this blog</a> for extended examples.</p> <p>Prior to Servlet 3.0, a <a href="http://en.wikipedia.org/wiki/De_facto" rel="nofollow noreferrer">de facto</a> standard to parse <code>multipart/form-data</code> requests would be using <a href="http://commons.apache.org/fileupload" rel="nofollow noreferrer">Apache Commons FileUpload</a>. Just carefully read its <em>User Guide</em> and <em>Frequently Asked Questions</em> sections to learn how to use it. I've posted an answer with a code example before <a href="https://stackoverflow.com/questions/2422468/upload-big-file-to-servlet/2424824#2424824">here</a> (it also contains an example targeting Servlet 3.0).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload