简体   繁体   English

如何在joomla 2.5中使用标准字段类型文件

[英]How to use standard field type file in joomla 2.5

I am trying to upload a file and i have used joomla xml form in joomla 2.5 version. 我正在尝试上传文件,并且在joomla 2.5版本中使用了joomla xml表单。 This form inserts image name in database. 该表格在数据库中插入图像名称。 but file is not uploaded. 但文件未上传。 Is there any tutorial for use of standard field type file in joomla form. 是否有使用joomla格式的标准字段类型文件的使用教程。

Yes you should use the media form field type example: 是的,您应该使用媒体表单字段类型示例:

<field name="myimage" type="media" directory="stories" />

You might have used the imagelist form field type example: 您可能使用了imagelist表单字段类型示例:

<field name="myimage" type="imagelist" default="" label="Select an image" description="" directory="" exclude="" stripext="" />

Which sounds like it is the wrong one. 听起来像是错误的。

Apparently the image uploaded using File in Joomla 2.5 is stored in temp folder. 显然,在Joomla 2.5中使用“文件”上传的图像存储在temp文件夹中。 Uploading image using "media" seems working but with limitations : 使用“媒体”上传图片似乎可行,但有局限性:

  • The user must have sufficient permission to do so. 用户必须具有足够的权限才能这样做。
  • if the user has permission, he can actually view everything in the folder which is not interesting situation 如果用户有权限,他实际上可以查看文件夹中的所有内容,这不是很有趣的情况

Using File is the better solution but you will need to write some php code to retrieve the uploaded image. 使用文件是更好的解决方案,但是您将需要编写一些php代码来检索上传的图像。

I know this is not an answer,it's just to show the way. 我知道这不是一个答案,只是为了说明。 I have the same problem and will be writing the php code shortly to manage the upload.I will update you with outcome. 我有同样的问题,将很快编写php代码来管理上传。我将用结果更新您。

Jacques 雅克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM