File upload in specific folder of web application

2019-05-11 08:33发布

I am using liferay 6.0.5. I am uploading file using following code.

UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest);
String submissionFileName = uploadRequest.getFileName("file");//uploaded filename
File submissionFile = uploadRequest.getFile("file");

this works fine and upload file in tomcat's temp directory with some different name. What I want is.."There is one folder docs in my project directory. I want uploaded file in this directory". How to do this in liferay..?

2条回答
干净又极端
2楼-- · 2019-05-11 08:43

If you want to change the temp directory for the file upload then you can change the following property in portal-ext.properties:

com.liferay.portal.upload.UploadServletRequestImpl.temp.dir=C:/MyTempDir

Hope this is what you are looking for.

查看更多
登录 后发表回答