You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by vi...@accenture.com on 2011/02/25 08:35:07 UTC

File Upload Issue

All,

                I am getting the following error while uploading a file.  Am using Struts 1.3.8 and Weblogic server 9.2 MP3 on  a UNIX environment.  Any thoughts on this issue?

<Feb 23, 2011 8:46:57 PM EST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContex
t@42bb13 - appName: 'ojp', name: 'ojp.war', context-path: '/ojp'] Root cause of ServletException.
org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. EOF
after reading only: '73728' of: '167276' promised bytes, out of which at least: '0' were already buffered
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
        at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestH
andler.java:185)
        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:405)
        at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
Thanks,
Vikram

________________________________
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Re: File Upload Issue

Posted by Paweł Wielgus <po...@gmail.com>.
Hi Vikram,
looks like user was uploading file of size x but after some bytes
trransfered server encountered end of file for it.
Strange, i see sometimes that user cancels his upload but is not the case.
Do You have the posibility to confirm what strange user is doing?
Or maybe it's just corrupted file?
Also, looking at the log it looks like your application has nothing to
do with it.

Best greetings,
Paweł Wielgus.


2011/2/25  <vi...@accenture.com>:
> All,
>
>                I am getting the following error while uploading a file.  Am using Struts 1.3.8 and Weblogic server 9.2 MP3 on  a UNIX environment.  Any thoughts on this issue?
>
> <Feb 23, 2011 8:46:57 PM EST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContex
> t@42bb13 - appName: 'ojp', name: 'ojp.war', context-path: '/ojp'] Root cause of ServletException.
> org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. EOF
> after reading only: '73728' of: '167276' promised bytes, out of which at least: '0' were already buffered
>        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
>        at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
>        at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestH
> andler.java:185)
>        at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:405)
>        at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)
>        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)
>        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>        at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> Thanks,
> Vikram
>
> ________________________________
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
>

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


RE: File Upload Issue

Posted by Martin Gainty <mg...@hotmail.com>.
i just executed the File-Upload action in struts-showcase-2.2.1.1 supplying the local MITLicense file I have 

Fileupload sample




File:


Caption:



 
after uploading MITLicense file I am displayed
Fileupload sample

ContentType: text/plain 
FileName: mitlicense.password 
File: 
C:\TOMCAT\apache-tomcat-6.0.20\work\Catalina\localhost\struts2-showcase-2.2.1.1\upload__1d06a9c3_12e5dd2a6e5__8000_00000000.tmp 

Caption:MITLicense 
this solution will work if you replace your faulty logic with working upload.jsp,upload-success.jsp,multipleUploadUsingList.jsp,multipleUploadUsingArray-success.jsp AND (org.apache.struts2.showcase.fileupload.FileUploadAction) code and validation and Action configuration from showcase 

here is the FileUploadAction-validation.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE validators PUBLIC 
          "-//OpenSymphony Group//XWork Validator 1.0.2//EN" 
          "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">

<validators>
    <field name="upload">
        <field-validator type="fieldexpression">
            <param name="expression"><![CDATA[upload.length() > 0]]></param>
            <message>File cannot be empty</message>
        </field-validator>
    </field>
    <field name="caption">
        <field-validator type="requiredstring">
            <message>Caption cannot be empty</message>
        </field-validator>
    </field>
</validators>          
          
and the original struts-fileupload.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">

<struts>
    <package name="fileupload" extends="struts-default" namespace="/fileupload">
        
        <action name="upload" class="org.apache.struts2.showcase.fileupload.FileUploadAction" method="input">
            <result>upload.jsp</result>
        </action>

        <action name="doUpload" class="org.apache.struts2.showcase.fileupload.FileUploadAction" method="upload">
            <result name="input">upload.jsp</result>
            <result>upload-success.jsp</result>
        </action>
        
        <action name="multipleUploadUsingList">
            <result>multipleUploadUsingList.jsp</result>
        </action>
        
        <action name="doMultipleUploadUsingList" class="org.apache.struts2.showcase.fileupload.MultipleFileUploadUsingListAction" method="upload">
            <result>multipleUploadUsingList-success.jsp</result>
        </action>

        <action name="multipleUploadUsingArray">
            <result>multipleUploadUsingArray.jsp</result>
        </action>

        <action name="doMultipleUploadUsingArray" class="org.apache.struts2.showcase.fileupload.MultipleFileUploadUsingArrayAction" method="upload">
            <result>multipleUploadUsingArray-success.jsp</result>
        </action>

    </package>
</struts>


HTH
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> From: vikram.g.byali@accenture.com
> To: user@struts.apache.org
> Date: Fri, 25 Feb 2011 13:05:07 +0530
> Subject: File Upload Issue
> 
> All,
> 
>                 I am getting the following error while uploading a file.  Am using Struts 1.3.8 and Weblogic server 9.2 MP3 on  a UNIX environment.  Any thoughts on this issue?
> 
> <Feb 23, 2011 8:46:57 PM EST> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContex
> t@42bb13 - appName: 'ojp', name: 'ojp.war', context-path: '/ojp'] Root cause of ServletException.
> org.apache.commons.fileupload.FileUploadException: Processing of multipart/form-data request failed. EOF
> after reading only: '73728' of: '167276' promised bytes, out of which at least: '0' were already buffered
>         at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:384)
>         at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:268)
>         at org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestH
> andler.java:185)
>         at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:405)
>         at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:818)
>         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:194)
>         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
>         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
> Thanks,
> Vikram
> 
> ________________________________
> This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.