Skip to main content

Posts

Showing posts from 2016

Liferay UploadRequest getFiles does not create temp files which has size lessthan ~ 1.5 KB or ~ 1 KB

Hello, If you are using the UploadRequest.getFileNames(“testFiles”) and if you upload file size less than around 1.5 KB Liferay is not creating the temp files and the we can not use those files for saving it in the document library. So the solution would be using the below code. InputStream[] streams = uploadReq.getFilesAsStream(“testFiles”); for(InputStream is : streams){                 File file = FileUtil. createTempFile (inputStream); }

Adding custom Eh Cache entry and changing default time out in Liferay

Hello, By default all the cache objects specified in the liferay-multi-vm-clustered.xml or in the liferay-single-vm.xml are set to default idle time out for 600 seconds (5 mins). Which means if a key in the cahe is not accessed for 5 minutes will be removed from the cache.  If you want to extends the time out or want to add your your own cache you can follow the below steps. I am doing it for the liferay-multi-vm-clustered.xml 1.      Goto liferay-portal-6.2-ee-sp10\tomcat-7.0.42\webapps\ROOT\WEB-INF\classes 2.      Inside the classes create a folder, i have created a folder with the name ehcache. 3.      Now copy liferay-multi-vm-clustered.xml file from the portal source. If you don't have the poral source code available with you, you can download it from here.  https://github.com/agmip/liferay-portal-impl/blob/master/src/ehcache/liferay-multi-vm-clustered.xml 4.    ...