文件上传在liferay中的Web应用程序的特定文件夹..? [英] File upload in specific folder of web application in liferay..?

查看:183
本文介绍了文件上传在liferay中的Web应用程序的特定文件夹..?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用liferay 6.0.5。我使用以下代码上传文件。


$ b

  UploadPortletRequest uploadRequest = PortalUtil.getUploadPortletRequest(actionRequest); 
字符串submissionFileName = uploadRequest.getFileName(file); //上传文件名
文件submissionFile = uploadRequest.getFile(file);

这个工作正常,并且在tomcat的临时目录中用一些不同的名字上传文件。我想要的是在我的项目目录中有一个文件夹文件,我想要在这个目录中上传文件。如何在liferay中做到这一点..?

解决方案

如果要更改文件上传的临时目录,则可以在portal-ext.properties中更改以下属性:

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

希望这是您要找的。

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..?

解决方案

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.

这篇关于文件上传在liferay中的Web应用程序的特定文件夹..?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆