将文件上传到服务器的Liferay [英] Uploading files to Liferay server

查看:404
本文介绍了将文件上传到服务器的Liferay的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Liferay 6.2 CE,我想补充一个简单的功能中,管理员可以将文件上传到服务器的Liferay并添加超链接到页面上此文件。

I'm using Liferay 6.2 CE and I would like to add a simple functionality in which administrator can upload files to liferay server and add hyperlink to this file on the page.

我Liferay的6.1文件,在该版本管理员可以只创建一个数据表,并添加文件上传现场有如下发现地:

I've found in Liferay's 6.1 documentation that in that version administrator could just create a data list and add File Upload field there as shown below:

不幸的是在6.2的Liferay这一领域不存在(我很困惑在这里有什么理由):

Unfortunately in Liferay 6.2 this field doesn't exist (I'm confused here what's the reason):

我也看到,在新的创造的博客文章,有这样一个具有功能图像添加HTML在浏览器中编辑。当pressed,用户可以选择从硬盘驱动器,然后上传到Liferay的服务器,并添加为一个文件< IMG> 标签的博客编辑器和链接目录看起来像: /documents/11469/0/UPLOADED_FILE.zip /

I also saw that during new blog post creation, there is this HTML in-browser editor that has functionality to add images. When pressed, user can select a file from a hard drive which is then uploaded to liferay server and added as <img> tag to the blog editor and links to directory that looks like that: /documents/11469/0/UPLOADED_FILE.zip/.

但它不是直观的用户上传的正常文件(如.zip文件),利用图像上传并手动编辑源$ C ​​$ c键更改&LT; IMG&GT; 标记正常&LT;一个方式&gt;

But it's not intuitive for a user to upload normal files (e.g. .zip file), by using image uploader and manually editing the source code to change <img> tags to normal <a> anchors.

所以我的问题是我是否需要以编程方式解决上述问题用API(我相信 DLFileEntryLocalServiceUtil 用于该目的),或者是否有任何其他的方式来实现这一目标使用Liferay的功能?

So my question is whether I need to solve described problem programatically using API (I believe that DLFileEntryLocalServiceUtil is used for that purpose) or is there any other way to achieve this using liferay functionalities?

推荐答案

通过Liferay的6.1文件上传字段重命名为文档领域的Liferay 6.2。

The "FileUpload" field by Liferay 6.1 is renamed to "Document" field in Liferay 6.2.

这篇关于将文件上传到服务器的Liferay的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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