]
Anh Vu Nguyen updated GTNPORTAL-2785:
-------------------------------------
Priority: Major (was: Minor)
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: