You can disable auto-generating ID’s with the following setting in
portal-ext.properties
:journal.article.force.autogenerate.id=false
A dashboard to begin with technical journey and a canvas to practice the learning. This blog mainly focuses on opensource technologies including Portal, CMS, Servers and Operating systems... just keep learning.
portal-ext.properties
:journal.article.force.autogenerate.id=false
Introduction: W
hile uploading a file in liferay we use the processAction() method of our MVC portlet class, wherein we use the following kind of code UploadPortletRequest uploadrequest = PortalUtil.getUploadPortletRequest(actionRequest);
On upload if the file size was less than 1kb, there is no temporary file created(Whenever an upload operation is done a temporary file in the temp folder of the tomcat is created which is been referred for any operation performed to use the file.
Solution: use input stream instead of getFile(), as follows:-
UploadPortletRequest uploadrequest = PortalUtil.getUploadPortletRequest(actionRequest);
InputStream[] inputStream = uploadrequest.getFilesAsStream("fileupload");
for(InputStream fileObj:inputStream){
File file = FileUtil.createTempFile(fileObj);
}
var array = typeof objArray != 'object' ? JSON.parse(objArray) : objArray;
var str = '';
for (var i = 0; i < array.length; i++) {
var line = '';
for (var index in array[i]) {
line += array[i][index] + ',';
}
line.slice(0,line.Length-1);
str += line + '\r\n';
}