Note that there are some explanatory texts on larger screens.

plurals
  1. POGlassfish 3.1.2.2 file upload
    primarykey
    data
    text
    <p>I'm having an issue when I try to upload a file in my application.</p> <p>The application server is Glassfish 3.1.2.2.</p> <p>Server side I'm using Spring MVC. So I declared in <code>beans.xml</code> :</p> <pre><code>&lt;bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/&gt; </code></pre> <p>In the controller, I have :</p> <pre><code>@RequestMapping(value = "/processUpload", method = RequestMethod.POST) @ResponseBody public Object processUpload(MultipartHttpServletRequest request) { ... do something with request.getFiles(...); ... } </code></pre> <p>On the client side, I'm using <code>XMLHttpRequest</code> :</p> <pre><code>xhr.open('POST', url, true); var formData = new FormData(); formData.append('something', ...); formData.append('file', file); </code></pre> <p>It's working with small files but with larges files, it keeps giving me this exception message :</p> <pre><code>Stream ended unexpectedly </code></pre> <p>What I tried :</p> <ul> <li><code>max-post-size-bytes="0"</code> or <code>max-post-size-bytes="1073741824"</code> (= 1go / test-file = 300mo) in domains.xml</li> <li>change web-core.jar with the one provided in <a href="https://java.net/jira/browse/GLASSFISH-18444" rel="nofollow">https://java.net/jira/browse/GLASSFISH-18444</a></li> <li>change commons-io, commons-fileupload with the ones in glassfish/libs</li> <li>change web-core independantly / change commons libs independantly</li> <li>use <code>&lt;bean id="multipartResolver" class="org.springframework.web.multipart.support.StandardServletMultipartResolver"&gt;</code> instead of commons-fileupload + <code>&lt;multipart-config&gt;</code> in web.xml</li> </ul> <p>Thanks in advance,</p> <p>Smoky</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. 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