[gatein-issues] [JBoss JIRA] (GTNPORTAL-2785) UploadService does not allow file with size exactly equals to the configured limit size

Trong Tran (JIRA) jira-events at lists.jboss.org
Tue Sep 17 06:31:04 EDT 2013


     [ https://issues.jboss.org/browse/GTNPORTAL-2785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Trong Tran resolved GTNPORTAL-2785.
-----------------------------------

    Resolution: Won't Fix


The usecase is not reality and a small difference is acceptable I think
                
> UploadService does not allow file with size exactly equals to the configured limit size
> ---------------------------------------------------------------------------------------
>
>                 Key: GTNPORTAL-2785
>                 URL: https://issues.jboss.org/browse/GTNPORTAL-2785
>             Project: GateIn Portal
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.4.0.Final
>            Reporter: Anh Vu Nguyen
>
> Using UploadService, user can not upload file with size exactly equals to the configured limit size.
> For example: 
>  1.Set limit size = 200 (MB)
>  2.Upload a file with size=209,715,200 bytes
>  3.The upload process is not successful
> When debugging, I saw this code fragment:
> {code}
>       double contentLength = request.getContentLength();
>       upResource.setEstimatedSize(contentLength);
>       if (isLimited(upResource, contentLength))
> ...
>       double estimatedSize = contentLength / limit.division;
>       if (limit.getLimit() > 0 && estimatedSize > limit.getLimit())
>       { // a limit set to 0 means unlimited         
>          if (log.isDebugEnabled())
>          {
>             log.debug("Upload cancelled because file bigger than size limit : " + estimatedSize + " " + limit.unit + " > " + limit.getLimit()
>                + " " + limit.unit);
>          }
>          return true;
>       }
> {code}
> In fact, the *contentLength* above is got from request. It equals to the file size + some additional metadata. So, it is a little bit bigger than the file size (200.0002MB as I saw).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the gatein-issues mailing list