commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arijit Mukherjee <Arijit.Mukher...@newcastle.ac.uk>
Subject Re: [fileupload] Help with Commons FileUpload
Date Mon, 09 Oct 2006 21:00:45 GMT
And, nothing happens on IE - I mean, as before, the code doesn't go through
the file handling bit. Oddly, while trying to do it via firefox, a couple of
files were really text/xml. If I choose other binary files instead of them,
the earlier problem comes back. And, this same code for files < 2GB
successfully uploads a combination of XML files, VMX files (VMWare config
files - text) and VMDK files (VMWare Virtual Hard Disk - binary).

Arijit


On 9/10/06 21:49, "Arijit Mukherjee" <Arijit.Mukherjee@newcastle.ac.uk>
wrote:

> Firefox/Safari/IE. This error came on a test on Firefox.
> 
> Arijit
> 
> 
> On 9/10/06 21:40, "Andrew" <lists@serff.net> wrote:
> 
>> What are you using to upload on the client side?
>> 
>> Andrew
>> Arijit Mukherjee wrote:
>>> I added a "maxHttpRequestHeader" parameter to the tomcat HTTP connector,
>>> setting it to a high value. After this the flow gets on a little bit
>>> further, but I'm getting an exception during the parseRequest call -
>>> 
>>> 2006-10-09 21:05:00,280 DEBUG [http-8090-Processor24]
>>> codestore.CodeStoreUploader (CodeStoreUploader.java:173)     - Handling
>>> file input...
>>> 2006-10-09 21:05:00,280 DEBUG [http-8090-Processor24]
>>> codestore.CodeStoreUploader (CodeStoreUploader.java:174)     - Request
>>> Content Length: -1
>>> 2006-10-09 21:05:00,280 DEBUG [http-8090-Processor24]
>>> codestore.CodeStoreUploader (CodeStoreUploader.java:207)     -
>>> processing upload request...
>>> 2006-10-09 21:05:00,280 DEBUG [http-8090-Processor24]
>>> codestore.CodeStoreUploader (CodeStoreUploader.java:222)     - Trying to
>>> upload...
>>> org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException
>>> : the request doesn't contain a multipart/form-data or multipart/mixed
>>> stream, content ty
>>>         at
>>> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase
>>> .java:299)
>>>         at
>>> uk.ac.ncl.neresc.dynasoar.codestore.CodeStoreUploader.handleFile(CodeSto
>>> reUploader.java:225)
>>>         at
>>> uk.ac.ncl.neresc.dynasoar.codestore.CodeStoreUploader.doPost(CodeStoreUp
>>> loader.java:175)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>>         at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
>>> tionFilterChain.java:237)
>>>         at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
>>> erChain.java:157)
>>>         at
>>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
>>> e.java:214)
>>>         at
>>> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>>> ntext.java:104)
>>>         at
>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>>> 20)
>>>         at
>>> org.apache.catalina.core.StandardContextValve.invokeInternal(StandardCon
>>> textValve.java:198)
>>>         at
>>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
>>> e.java:152)
>>>         at
>>> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>>> ntext.java:104)
>>>         at
>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>>> 20)
>>>         at
>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
>>> :137)
>>>         at
>>> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>>> ntext.java:104)
>>>         at
>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
>>> :118)
>>>         at
>>> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>>> ntext.java:102)
>>>         at
>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>>> 20)
>>>         at
>>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
>>> java:109)
>>>         at
>>> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveCo
>>> ntext.java:104)
>>>         at
>>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:5
>>> 20)
>>>         at
>>> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
>>>         at
>>> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
>>>         at
>>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79
>>> 9)
>>>         at
>>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
>>> onnection(Http11Protocol.java:705)
>>>         at
>>> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57
>>> 7)
>>>         at
>>> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
>>> .java:683)
>>> 
>>> It says that the request is not multipart form-data - but I've already
>>> done that -
>>> 
>>>        out.println("Please provide the VM name and select the
>>> files you wish to upload and then click the Upload button");
>>>                     out.println("<br/>");
>>>                     out.println("<b>");
>>>                     out.println("Please make sure that the 1st entry is
>>> the config file, the 2nd entry is the XML description and the other
>>> entires are for the hard disk(s)");
>>>                     out.println("</b>");
>>>                     out.println("<br/>");
>>>                     out.println("<form enctype=\"multipart/form-data\"
>>> action=\"CodeStoreUploader\" method=POST>");
>>>                     out.println("<b>");
>>>                     out.println("VM Name ");
>>>                     out.println("</b>");
>>>                     out.println("<input name=vmname type=text size=30");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=configfile type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=descfile type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=virtualharddisk1 type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=virtualharddisk2 type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=virtualharddisk3 type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=virtualharddisk4 type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input name=virtualharddisk5 type=file
>>> size=100");
>>>                     out.println("<br/>");
>>>                     out.println("<input type=submit value=Upload>");
>>> 
>>> What could have gone wrong?
>>> 
>>> Regards
>>> Arijit
>>> 
>>> 
>>>   
>>>> -----Original Message-----
>>>> From: Arijit Mukherjee [mailto:Arijit.Mukherjee@newcastle.ac.uk]
>>>> Sent: 09 October 2006 16:40
>>>> To: Jakarta Commons Users List
>>>> Subject: RE: [fileupload] Help with Commons FileUpload
>>>> 
>>>> The servlet is on Tomcat 5.0.28. I was trying to find out if
>>>> that has a limit in the max size - found nothing yet, and the
>>>> same tomcat and same file upload code works fine on a
>>>> powerbook, which made me think about the 32bit/64bit thing...
>>>> 
>>>> Arijit
>>>> 
>>>>     
>>>>> -----Original Message-----
>>>>> From: Andrew [mailto:lists@serff.net]
>>>>> Sent: 09 October 2006 16:28
>>>>> To: Jakarta Commons Users List
>>>>> Subject: Re: [fileupload] Help with Commons FileUpload
>>>>> 
>>>>> What are you running on?  Apache/Jakarta/Jboss?  What version?
>>>>> 
>>>>> Andrew
>>>>> Arijit Mukherjee wrote:
>>>>>       
>>>>>> Thanx Andrew - but I've already tried a nightly build - it
>>>>>>         
>>>>> didn't help.
>>>>>       
>>>>>> Seems like the request doesn't even reach the server's file
>>>>>>         
>>>> handling 
>>>>     
>>>>>> method:-((
>>>>>> 
>>>>>> Arijit
>>>>>> 
>>>>>>   
>>>>>>         
>>>>>>> -----Original Message-----
>>>>>>> From: Andrew [mailto:lists@serff.net]
>>>>>>> Sent: 09 October 2006 16:12
>>>>>>> To: Jakarta Commons Users List
>>>>>>> Subject: Re: [fileupload] Help with Commons FileUpload
>>>>>>> 
>>>>>>> Yes, contentLength is an INT.  That is what was killing me
>>>>>>>           
>>>>> when using
>>>>>       
>>>>>>> FileUpload 1.1.1.  It would get a negative number as the content
>>>>>>> length and throw that UnknownSizeException.
>>>>>>> The nightly builds seem to have fixed that for me though as they
>>>>>>> actually pay attention to the maxSize parameter now (i.e.
>>>>>>> if it is -1, then ignore contentSize).
>>>>>>> 
>>>>>>> As for the 32 bit windows/linux, i haven't tried that.
>>>>>>>           
>>>> I'm running 
>>>>     
>>>>>>> on
>>>>>>> 64 bit linux/solaris.
>>>>>>> 
>>>>>>> Andrew
>>>>>>> Arijit Mukherjee wrote:
>>>>>>>     
>>>>>>>           
>>>>>>>> By any chance, can it be limited by the contentLength of
the http
>>>>>>>> request - because that's an INT?
>>>>>>>> 
>>>>>>>> Arijit
>>>>>>>> 
>>>>>>>>   
>>>>>>>>       
>>>>>>>>           
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: Arijit Mukherjee [mailto:Arijit.Mukherjee@newcastle.ac.uk]
>>>>>>>>> Sent: 09 October 2006 14:50
>>>>>>>>> To: Jakarta Commons Users List
>>>>>>>>> Subject: [fileupload] Help with Commons FileUpload
>>>>>>>>> 
>>>>>>>>> Hi All
>>>>>>>>> 
>>>>>>>>> It's about the max allowable upload again.
>>>>>>>>> 
>>>>>>>>> Earlier, I was trying to upload a single file (from a
servlet)
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> 2GB, which didn't work. The methods I've been using
are as
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> in the mail below.
>>>>>>>>> It seems that the "handleFile" method isn't being invoked
at all.
>>>>>>>>> 
>>>>>>>>> I tried to break the file into smaller chunks < 2GB,
but
>>>>>>>>>         
>>>>>>>>>          
>>>>>>> even in that
>>>>>>>     
>>>>>>>           
>>>>>>>>> case, the upload doesn't work, and now I'm getting an
error
>>>>>>>>>         
>>>>>>>>>          
>>>>>>> from the
>>>>>>   
>>>>>>         
>>>>>>>>> browser -
>>>>>>>>> 
>>>>>>>>> "The connection was reset
>>>>>>>>> The connection to the server was reset while the page
>>>>>>>>>          
>>>> was loading.
>>>>     
>>>>>>>>>    *   The site could be temporarily unavailable or too
busy.
>>>>>>>>> Try again
>>>>>>>>> in a few
>>>>>>>>>          moments.
>>>>>>>>>    *   If you are unable to load any pages, check your
computer's
>>>>>>>>> network
>>>>>>>>>          connection.
>>>>>>>>>    *   If your computer or network is protected by a
firewall
>>>>>>>>> or proxy,
>>>>>>>>> make sure
>>>>>>>>>          that Firefox is permitted to access the Web."
>>>>>>>>> 
>>>>>>>>> There is a similar error on IE too.
>>>>>>>>> 
>>>>>>>>> My question is - if there is a problem with the file
>>>>>>>>>          
>>>>> size, then the
>>>>>       
>>>>>>>>> servlet should throw an exception while invoking the
>>>>>>>>>          
>>>>> commons upload
>>>>>       
>>>>>>>>> APIs. But, it's not going there at all - as it seems.
I had
>>>>>>>>>         
>>>>>>>>>          
>>>>>>> a feeling
>>>>>>>     
>>>>>>>           
>>>>>>>>> that there might be limits in size in the HTTP request
>>>>>>>>>          
>>>>> itself - but
>>>>>       
>>>>>>>>> even that's not the case because I've been able to upload
bigger
>>>>>>>>> files with the same code on a Mac Powerbook (using
>>>>>>>>>          
>>>> commons-upload
>>>>     
>>>>>>>>> 1.0). It's failing when I'm trying to do the same thing
>>>>>>>>>          
>>>>> on a WinXP
>>>>>       
>>>>>>>>> machine or a Linux machine. Earlier I posted a message
>>>>>>>>>          
>>>> suspecting 
>>>>     
>>>>>>>>> that it probably has something to do with addressing
>>>>>>>>>          
>>>>> system of the
>>>>>       
>>>>>>>>> machines - like 64 bit or 32 bits - but I thought that
>>>>>>>>>          
>>>>> would be the
>>>>>       
>>>>>>>>> case for a single file size.
>>>>>>>>> 
>>>>>>>>> Has anyone been able to upload files > 2GB on a windows
or linux
>>>>>>>>> (32
>>>>>>>>> bit) system? Can you please give me some pointers?
>>>>>>>>> 
>>>>>>>>> Thanx in advance
>>>>>>>>> Arijit
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> 
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Arijit Mukherjee [mailto:Arijit.Mukherjee@newcastle.ac.uk]
>>>>>>>>>> Sent: 02 October 2006 17:09
>>>>>>>>>> To: commons-user@jakarta.apache.org
>>>>>>>>>> Subject: Commons - Help with Commons FileUpload
>>>>>>>>>> 
>>>>>>>>>> Hi All
>>>>>>>>>> 
>>>>>>>>>> I have been using the Apache Commons FileUpload package
>>>>>>>>>>         
>>>> for some 
>>>>     
>>>>>>>>>> time (mostly simple use cases) but stuck into something
>>>>>>>>>>         
>>>> recently.
>>>>     
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> I'm trying
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> to upload files (greater than 2GB) onto a server
using
>>>>>>>>>>         
>>>>> the commons
>>>>>       
>>>>>>>>>> upload package within a servlet (inside tomcat).
Anything
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> less than 2GB
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> works alright (although slowly), but anything more
than
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>> that simply
>>>>>>>     
>>>>>>>           
>>>>>>>>>> doesn't do anything. In the "doPost" method of the
servlet, I
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> have two
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> options based on an init parameter - either handling
the
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>> option, or
>>>>>>>     
>>>>>>>           
>>>>>>>>>> handling the file - so the commons API's are used
in the
>>>>>>>>>> handleFile() method -
>>>>>>>>>> 
>>>>>>>>>> public void doPost(HttpServletRequest request,
>>>>>>>>>>         
>>>>> HttpServletResponse
>>>>>       
>>>>>>>>>> response)
>>>>>>>>>>            throws IOException, ServletException {
>>>>>>>>>>        try {
>>>>>>>>>>            if (!init) {
>>>>>>>>>>                mLog.debug("Handling file input...");
>>>>>>>>>>                handleFile(request, response);
>>>>>>>>>>            } else {
>>>>>>>>>>                mLog.debug("Handling option input...");
>>>>>>>>>>                handleRadioOption(request, response);
>>>>>>>>>>            }
>>>>>>>>>>        } catch (Exception ex) {
>>>>>>>>>>            ex.printStackTrace();
>>>>>>>>>>        }
>>>>>>>>>> }
>>>>>>>>>> 
>>>>>>>>>> private void handleFile(HttpServletRequest request,
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> HttpServletResponse
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> response)
>>>>>>>>>>                            throws IOException,
>>>>>>>>>>         
>>>> ServletException {
>>>>     
>>>>>>>>>> PrintWriter out = response.getWriter();
>>>>>>>>>> ...
>>>>>>>>>> boolean isMultipart =
>>>>>>>>>> ServletFileUpload.isMultipartContent(request);
>>>>>>>>>> // Create a new file upload handler
>>>>>>>>>>            FileItemFactory factory = new DiskFileItemFactory();
>>>>>>>>>>            ServletFileUpload upload = new
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>> ServletFileUpload(factory);
>>>>>>>     
>>>>>>>           
>>>>>>>>>>            // Set overall request size constraint
>>>>>>>>>>            upload.setSizeMax(-1);
>>>>>>>>>>            upload.setFileSizeMax(-1);
>>>>>>>>>>            // Parse the request
>>>>>>>>>>            List items = upload.parseRequest(request);
>>>>>>>>>> ...
>>>>>>>>>> }
>>>>>>>>>> 
>>>>>>>>>> It seems that when the files are selected and the
"upload"
>>>>>>>>>> button is clicked on the browser (a submit action),
the
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> control doesn't
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> go into this method at all - only when one of the
files are
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> larger than
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> 2GB - otherwise, it executes fine.
>>>>>>>>>> I've tried several combinations for setting the max
file
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> size, but none
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> seem to work. Can it be related to the servlet APIs
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>> somehow? Is the
>>>>>>>     
>>>>>>>           
>>>>>>>>>> httpRequest size too large in this case?
>>>>>>>>>> 
>>>>>>>>>> Thanx in advance for any help.
>>>>>>>>>> 
>>>>>>>>>> Regards
>>>>>>>>>> Arijit
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> "And when the night is cloudy,
>>>>>>>>>> There is still a light that shines on me, Shine on
until
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>>>>>> tomorrow, let
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>>>>>>> it be. "
>>>>>>>>>> 
>>>>>>>>>> John Lennon/Paul McCartney
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>       
>>>>>>>>>>         
>>>>>>>>>>         
>>>>> ---------------------------------------------------------------------
>>>>>       
>>>>>>>     
>>>>>>>           
>>>>>>>>> To unsubscribe, e-mail:
>>>>>>>>>          
>>>>> commons-user-unsubscribe@jakarta.apache.org
>>>>>       
>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>         
>>>>>>>>>          
>>>>>>> commons-user-help@jakarta.apache.org
>>>>>>>     
>>>>>>>           
>>>>>>>>>     
>>>>>>>>>         
>>>>>>>>>          
>>>>> --------------------------------------------------------------------
>>>>>       
>>>>>>>> - To unsubscribe, e-mail:
>>>>>>>> commons-user-unsubscribe@jakarta.apache.org
>>>>>>>> For additional commands, e-mail:
>>>>>>>> commons-user-help@jakarta.apache.org
>>>>>>>> 
>>>>>>>>   
>>>>>>>>       
>>>>>>>>           
>>>>>>>           
>>>>> ---------------------------------------------------------------------
>>>>>       
>>>>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>>> For additional commands, e-mail:
>>>>>>>           
>>>>> commons-user-help@jakarta.apache.org
>>>>>       
>>>>>>>     
>>>>>>>           
>>>>>>         
>>>> ---------------------------------------------------------------------
>>>>     
>>>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>>> For additional commands, e-mail:
>>>>>>         
>>>> commons-user-help@jakarta.apache.org
>>>>     
>>>>>>   
>>>>>>         
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>> 
>>>>> 
>>>>>       
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>> 
>>>> 
>>>>     
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>> 
>>>   
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


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


Mime
View raw message