You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by an...@akeryards.com on 2006/06/08 10:57:40 UTC

Problem using commons-fileupload.jar



Hello,

I'm using fileupload, and have this exception :

org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. Stream ended unexpectedly

This is very strange since it works well on my own computer and this exception is catched when I run my program on an other server.

I don't know wether this information can help, but the server I used (where there is an error) use a IIS authentification (between client and server
Tomcat 5).

Could you help me ?

Here is my code very simple code :

protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1) throws ServletException, IOException
      {

            this.processRequest(arg0, arg1);
      }

private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
      {

            this.out = response.getWriter();
            boolean isMultipart = FileUpload.isMultipartContent(request);
            if (!isMultipart)
            {
                  this.writeOutput("non MultiPart Message");
                  return;
            }
            DiskFileUpload fileUpload = new DiskFileUpload();
            try
            {
                  List items = fileUpload.parseRequest(request);
                  this.writeOutput("OK");
            }
            catch (FileUploadException e)
            {
                  this.writeOutput(e.toString());
            }
            catch (NullPointerException e)
            {
                  this.writeOutput(e.toString());
            }
      }

The exception seems to be catched at this line : List items = fileUpload.parseRequest(request);




     CONFIDENTIALITE : Ce message et les éventuelles pièces attachées sont
     confidentiels. Si vous n'êtes pas dans la liste des destinataires,
     veuillez informer l'expéditeur immédiatement et ne pas divulguer le
     contenu à une tierce personne, ne pas l'utiliser pour quelque raison
     que ce soit, ne pas stocker ou copier l'information qu'il contient sur
     un quelconque support.

     CONFIDENTIALITY : This  e-mail  and  any attachments are confidential
     and may be privileged. If  you are not a named recipient, please
     notify the sender immediately and do not disclose the contents to
     another person, use it for any purpose or store or copy the
     information in any medium..


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


[VFS] Terminating resolveFile

Posted by hrjk <ha...@zeniitti.net>.
Hi.

Would it be a bad idea to add a mechanism to terminate file resolving
phase at some point? For example, reading a 2Gb zip file will take a
while. It would be splended, if one could give a signal to
resolveFile-method to abort the operation.

BR,
-hrjk


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Problem using commons-fileupload.jar

Posted by Martin Cooper <ma...@apache.org>.
On 6/8/06, antoine.robert-stagiaire@akeryards.com <
antoine.robert-stagiaire@akeryards.com> wrote:
>
>
>
>
> Hello,
>
> I'm using fileupload, and have this exception :
>
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-data request failed. Stream ended unexpectedly
>
> This is very strange since it works well on my own computer and this
> exception is catched when I run my program on an other server.
>
> I don't know wether this information can help, but the server I used
> (where there is an error) use a IIS authentification (between client and
> server
> Tomcat 5).


You may be running into this issue:

http://jakarta.apache.org/commons/fileupload/faq.html#read-timeout

The exception is different, but the cause could well be the same.

--
Martin Cooper


Could you help me ?
>
> Here is my code very simple code :
>
> protected void doPost(HttpServletRequest arg0, HttpServletResponse arg1)
> throws ServletException, IOException
>       {
>
>             this.processRequest(arg0, arg1);
>       }
>
> private void processRequest(HttpServletRequest request,
> HttpServletResponse response) throws ServletException, IOException
>       {
>
>             this.out = response.getWriter();
>             boolean isMultipart = FileUpload.isMultipartContent(request);
>             if (!isMultipart)
>             {
>                   this.writeOutput("non MultiPart Message");
>                   return;
>             }
>             DiskFileUpload fileUpload = new DiskFileUpload();
>             try
>             {
>                   List items = fileUpload.parseRequest(request);
>                   this.writeOutput("OK");
>             }
>             catch (FileUploadException e)
>             {
>                   this.writeOutput(e.toString());
>             }
>             catch (NullPointerException e)
>             {
>                   this.writeOutput(e.toString());
>             }
>       }
>
> The exception seems to be catched at this line : List items =
> fileUpload.parseRequest(request);
>
>
>
>
>      CONFIDENTIALITE : Ce message et les éventuelles pièces attachées sont
>      confidentiels. Si vous n'êtes pas dans la liste des destinataires,
>      veuillez informer l'expéditeur immédiatement et ne pas divulguer le
>      contenu à une tierce personne, ne pas l'utiliser pour quelque raison
>      que ce soit, ne pas stocker ou copier l'information qu'il contient
> sur
>      un quelconque support.
>
>      CONFIDENTIALITY : This  e-mail  and  any attachments are confidential
>      and may be privileged. If  you are not a named recipient, please
>      notify the sender immediately and do not disclose the contents to
>      another person, use it for any purpose or store or copy the
>      information in any medium..
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>