List Info

Thread: Created: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than DiskFileIte




Created: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than DiskFileIte
user name
2006-12-08 12:41:58
File upload with JakartaMultipartRequest fails if file size
less than DiskFileItem.sizeThreshold
------------------------------------------------------------
------------------------------------

                 Key: WW-1549
                 URL: http:/
/issues.apache.org/struts/browse/WW-1549
             Project: Struts 2
          Issue Type: Bug
          Components: Interceptors
    Affects Versions: 2.0.2
         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
            Reporter: Tomas Carlsson
            Priority: Minor


commons-fileupload DiskFileItem will not write any data to
the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Updated: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than DiskFileIte
user name
2006-12-08 12:45:57
     [ http://issues.apache.org/struts/browse/WW-1549?page=all ]

Tomas Carlsson updated WW-1549:
-------------------------------

    Attachment: s2_28850.patch.gz

Quick fix for this problem.

> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: http:/
/issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.2
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>            Priority: Minor
>         Attachments: s2_28850.patch.gz
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Updated: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than DiskFileIte
user name
2006-12-08 13:02:57
     [ http://issues.apache.org/struts/browse/WW-1549?page=all ]

Tomas Carlsson updated WW-1549:
-------------------------------

    Attachment: s2_28850_v2.patch

IGNORE the first patch that I attached.

I realized that the real reason for this bug is that the
property "struts.multipart.maxSize" is used in the
wrong way. Instead of actually limiting the upload size by
calling ServletFileUpload.setSizeMax() it is used to set the
amount of bytes to store in memory before writing to disk
(DiskFileItemFactory.setSizeThreshold()).

This new patch (s2_28850_v2.patch) fixes this problem.



> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: http:/
/issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.2
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>            Priority: Minor
>         Attachments: s2_28850.patch.gz,
s2_28850_v2.patch
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Resolved: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than DiskFileIt
user name
2006-12-08 18:40:57
     [ http://issues.apache.org/struts/browse/WW-1549?page=all ]

Don Brown resolved WW-1549.
---------------------------

    Fix Version/s: 2.0.2
       Resolution: Fixed
         Assignee: Don Brown

Fixed, thanks for the patch!

> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: http:/
/issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.2
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>         Assigned To: Don Brown
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: s2_28850.patch.gz,
s2_28850_v2.patch
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the
administrators: http://issues.apache.org/struts/secure/Administrators.
jspa
-
For more information on JIRA, see: http://www.atl
assian.com/software/jira

        
Updated: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than Disk
country flaguser name
United States
2007-07-28 18:49:06
     [ https://issues.apache.org/struts/browse/WW-1549?page=com.at
lassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Racon updated WW-1549:
-----------------------------

    Affects Version/s:     (was: 2.0.2)
                       2.1.0
                       2.0.10

By adding upload.setSizeMax to JakartaMultiPartRequest, the
file upload interceptor max size validation has been
disabled. Furthermore, whenever there is a single file above
the allowed size none of the request parameters are set on
the action This happens due to
upload.parseRequest(createRequestContext(servletRequest))
which throws exception
(o.a.c.fileupload.FileItemIteratorImpl checks max size). 
If the application requires the parameters it will fail. 

There is also slight confusion and disconnect between:
struts.multipart.maxSize and fileInterceptor.maxsize

If you upload file that exceeds allowed
struts.multipart.maxSize fileInterceptor will never kick in.


IMHO file upload interceptor should be responsible for max
size validation (esp. that it reports errors as field errors
and not as action errors). 
Furthermore, we should drop 'struts.multipart.maxSize' since
is confusing along with fileInterceptor.maxsize, also
fileInterceptor.maxsize should get a new default max size.
The other option is to use struts.multipart.maxSize to set
fileInterceptor.maxsize.

This line should be removed so file interceptor can validate
files:
------
Index:
src/main/java/org/apache/struts2/dispatcher/multipart/Jakart
aMultiPartRequest.java
============================================================
=======
---
src/main/java/org/apache/struts2/dispatcher/multipart/Jakart
aMultiPartRequest.java  (revision 560614)
+++
src/main/java/org/apache/struts2/dispatcher/multipart/Jakart
aMultiPartRequest.java  (working copy)
 -86,7
+86,6 
         // Parse the request
         try {
             ServletFileUpload upload = new
ServletFileUpload(fac);
-            upload.setSizeMax(maxSize);
             List items =
upload.parseRequest(createRequestContext(servletRequest));

--------------


> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: https
://issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.10, 2.1.0
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>            Assignee: Don Brown
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: s2_28850.patch.gz,
s2_28850_v2.patch
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Commented: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than Di
country flaguser name
United States
2007-07-28 21:51:05
    [ https://issues.apache.org/struts/browse/WW
-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:c
omment-tabpanel#action_41682 ] 

James Holmes commented on WW-1549:
----------------------------------

Lukasz, you need to re-open this ticket or create another
one if you want changes to be made. This ticket will not
"show up on the radar" because it currently has a
status of resolved.

> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: https
://issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.10, 2.1.0
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>            Assignee: Don Brown
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: s2_28850.patch.gz,
s2_28850_v2.patch
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


Commented: (WW-1549) File upload with JakartaMultipartRequest fails if file size less than Di
country flaguser name
United States
2007-07-29 03:05:05
    [ https://issues.apache.org/struts/browse/WW
-1549?page=com.atlassian.jira.plugin.system.issuetabpanels:c
omment-tabpanel#action_41683 ] 

Lukasz Racon commented on WW-1549:
----------------------------------

New ticked has been created for this issue: https
://issues.apache.org/struts/browse/WW-2073

PS. Thanks for the reminder. I was trying to check if
original issue reporter/person who fixed it, had more
reasons behind adding "upload.setSizeMax(maxSize);
"

> File upload with JakartaMultipartRequest fails if file
size less than DiskFileItem.sizeThreshold
>
------------------------------------------------------------
------------------------------------
>
>                 Key: WW-1549
>                 URL: https
://issues.apache.org/struts/browse/WW-1549
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.10, 2.1.0
>         Environment: Win XP, J2SE 1.5.0_08,
struts-core-2.0.2-SNAPSHOT (Dec 07)
>            Reporter: Tomas Carlsson
>            Assignee: Don Brown
>            Priority: Minor
>             Fix For: 2.0.2
>
>         Attachments: s2_28850.patch.gz,
s2_28850_v2.patch
>
>
> commons-fileupload DiskFileItem will not write any data
to the file system until its sizeThreshold has been reached.
This is not considered in JakartaMultipartRequest. It should
check this when getting the File object that is later
injected to an Action.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue
online.


[1-7]

about | contact  Other archives ( Real Estate discussion Medical topics )