Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: DL upload file limit
Dear All,I tried to upload the file and actual file size is only 3 bytes. But while i tried to upload than it is change the file size and become big. After that the exception is coming out as per following. I am taking example from http://liferayiseasy.blogspot.com/2015/07/how-to-upload-documents-and-files-in.html. Please suggest, i tried to maximize the file size limit in portal-ext.properties (dl.file.max.size=1048576000, com.liferay.portal.upload.UploadServletRequestImpl.max.size=1048576000). i would like to know 1. why the file size is big after upload to the portal, 2. I update portal-ext.properties and restart the server but it is not effect on maximum file size. Please suggest. Thank you2019-06-16 06:36:20.227 INFO [http-nio-8080-exec-1][UserCreationPortlet:121] Calling fileUpload()
2019-06-16 06:36:20.228 INFO [http-nio-8080-exec-1][UserCreationPortlet:123] File Name : aaa.txt
2019-06-16 06:36:20.230 INFO [http-nio-8080-exec-1][UserCreationPortlet:125] file size : 420210536448
2019-06-16 06:36:20.231 INFO [http-nio-8080-exec-1][UserCreationPortlet:128] mimeType :text/plain
2019-06-16 06:36:20.231 INFO [http-nio-8080-exec-1][UserCreationPortlet:131] Title=>aaa.txt
2019-06-16 06:36:20.233 INFO [http-nio-8080-exec-1][UserCreationPortlet:137] Size Before adding file entry is : 420210536448
2019-06-16 06:36:20.243 ERROR [http-nio-8080-exec-1][UserCreationPortlet:143] 420210536448 exceeds the maximum permitted size of 104857600 for file aaa.txt
com.liferay.document.library.kernel.exception.FileSizeException: 420210536448 exceeds the maximum permitted size of 104857600 for file aaa.txt
2019-06-16 06:36:20.228 INFO [http-nio-8080-exec-1][UserCreationPortlet:123] File Name : aaa.txt
2019-06-16 06:36:20.230 INFO [http-nio-8080-exec-1][UserCreationPortlet:125] file size : 420210536448
2019-06-16 06:36:20.231 INFO [http-nio-8080-exec-1][UserCreationPortlet:128] mimeType :text/plain
2019-06-16 06:36:20.231 INFO [http-nio-8080-exec-1][UserCreationPortlet:131] Title=>aaa.txt
2019-06-16 06:36:20.233 INFO [http-nio-8080-exec-1][UserCreationPortlet:137] Size Before adding file entry is : 420210536448
2019-06-16 06:36:20.243 ERROR [http-nio-8080-exec-1][UserCreationPortlet:143] 420210536448 exceeds the maximum permitted size of 104857600 for file aaa.txt
com.liferay.document.library.kernel.exception.FileSizeException: 420210536448 exceeds the maximum permitted size of 104857600 for file aaa.txt
Attachments:
Please show us the code of UserCreationPortlet. Also, which version of Liferay do you use?
Hi Christoph,
I am using liferay CE 7.1.3. Please see the attached view.jsp and UserCreationPortlet.java for code. Thank you
I am using liferay CE 7.1.3. Please see the attached view.jsp and UserCreationPortlet.java for code. Thank you
Attachments:
The java.io.File.getTotalSpace() method returns the size of the partition, not the size of the file.
Thanks Christoph, I updated with file.length() method and it is working fine.