You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Aymeric Levaux (JIRA)" <ji...@apache.org> on 2007/06/07 14:27:27 UTC

[jira] Created: (WW-1976) FileUplaod does not ignore 0Kb files when using Jakarta FileUpload impl

FileUplaod does not ignore 0Kb files when using Jakarta FileUpload impl
-----------------------------------------------------------------------

                 Key: WW-1976
                 URL: https://issues.apache.org/struts/browse/WW-1976
             Project: Struts 2
          Issue Type: Bug
          Components: Interceptors
    Affects Versions: 2.0.8
            Reporter: Aymeric Levaux


When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
This means that a file is injected in the action even if nothing was uploaded. 

In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:

else if (item.getSize() == 0) {
  log.warn("Item is a file upload of 0 size, ignoring");
}

In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.

Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Resolved: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes resolved WW-1976.
------------------------------

    Resolution: Fixed

This has been fixed via WW-1911. As mentioned by Lukasz Racon, checking the file size will not accomodate 0-length files which is a valid scenario. Instead the file name is checked.

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: 2.0.10
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Updated: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Aymeric Levaux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aymeric Levaux updated WW-1976:
-------------------------------

    Attachment: JakartaMultiPartRequest.java.patch

Added a patch to fix  this issue.

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8
>            Reporter: Aymeric Levaux
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Commented: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Lukasz Racon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_41199 ] 

Lukasz Racon commented on WW-1976:
----------------------------------

Same problem, slightly different solution:
https://issues.apache.org/struts/browse/WW-1911

IMHO, we should check the file name not the size. 
I can envision people uploading empty files and expecting that it will appear in the action as empty file.

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8
>            Reporter: Aymeric Levaux
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Commented: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Anne Lee (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43388#action_43388 ] 

Anne Lee commented on WW-1976:
------------------------------

Hi, I have a question about the 0 byte files verification.

Does the verification code in JakartaMultiPartRequest.java.patch is a formal release? 

Because I don't see this code in struts-2.0.11 and it still has exception when user try to upload a 0 byte file.

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: 2.0.10
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Assigned: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes reassigned WW-1976:
--------------------------------

    Assignee: James Holmes

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: Future
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Updated: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-1976:
-----------------------------

    Affects Version/s: 2.0.9

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: Future
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Commented: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43389#action_43389 ] 

Dave Newton commented on WW-1976:
---------------------------------

See the link to WW-1911 referred to by James Holmes' comment.

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: 2.0.10
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Updated: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Ted Husted (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Husted updated WW-1976:
---------------------------

    Fix Version/s: Future

Setting Fix Version to "future" for issues without a set fix version. 


> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8
>            Reporter: Aymeric Levaux
>             Fix For: Future
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Updated: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "Aymeric Levaux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aymeric Levaux updated WW-1976:
-------------------------------

    Summary: FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl  (was: FileUplaod does not ignore 0Kb files when using Jakarta FileUpload impl)

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8
>            Reporter: Aymeric Levaux
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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


[jira] Updated: (WW-1976) FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl

Posted by "James Holmes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James Holmes updated WW-1976:
-----------------------------

    Fix Version/s:     (was: Future)
                   2.0.10

> FileUpload does not ignore 0 byte files when using Jakarta FileUpload impl
> --------------------------------------------------------------------------
>
>                 Key: WW-1976
>                 URL: https://issues.apache.org/struts/browse/WW-1976
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Interceptors
>    Affects Versions: 2.0.8, 2.0.9
>            Reporter: Aymeric Levaux
>            Assignee: James Holmes
>             Fix For: 2.0.10
>
>         Attachments: JakartaMultiPartRequest.java.patch
>
>
> When not selecting any file to upload in a file input, Struts does not ignore the 0 byte file returned by jakarta FileUpload.
> This means that a file is injected in the action even if nothing was uploaded. 
> In webwork the check was done in the constructor of  com.opensymphony.webwork.dispatcher.multipart.JakartaMultiPartRequest:
> else if (item.getSize() == 0) {
>   log.warn("Item is a file upload of 0 size, ignoring");
> }
> In struts the parsing of the request moved from the constructor to a parse method but the above check disappeared.
> Additionally this behaviour is inconsistant with the "pell" implementation that ignores 0 byte files.

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