简体   繁体   English

使用新字段上传时出现drupal 7错误

[英]drupal 7 error when uploading with new field

I've got a very strange problem using drupal 7. I've got a wbesite running and using views and content types I have been able to build a lot of functionality. 使用drupal 7时遇到了一个非常奇怪的问题。运行了wbesite并使用了视图和内容类型,我已经能够构建很多功能。 Now the following occurs: 现在发生以下情况:

When I add a new field to a content type (new or existing) of the the type file or image, I have this field in the form but when I try to upload a file or image using this form it gives an error "The file could not be uploaded" or the full error (from the recent log messages): "The upload directory public:// for the file field field_katapult_voorpagina could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled." 当我向类型文件或图像的内容类型(新的或现有的)添加新字段时,我在表单中具有该字段,但是当我尝试使用此表单上载文件或图像时,会出现错误“无法上传”或完整错误(来自最近的日志消息):“无法创建文件字段field_katapult_voorpagina的上传目录public://,或者无法访问。新上传的文件无法保存在此目录中结果,上传被取消了。”

Strangely, when I upload a file or image using an older existing field (pointing to the same directory: public://) it does not give an error and the files upload without a problem. 奇怪的是,当我使用一个较旧的现有字段(指向同一目录:public://)上传文件或图像时,它没有给出错误,并且文件上传没有问题。 So this makes me think that the server settings are actually set properly. 因此,这使我认为服务器设置实际上已正确设置。

Anybody who can help me with this problem? 有人可以帮助我解决这个问题吗? If not, can anybody point me in the right direction as to where I can find the files that handle the upload process in drupal 7? 如果不是,那么有人可以向我指出在drupal 7中可以找到用于处理上传过程的文件的正确方向吗?

Many thanks in advance! 提前谢谢了!

You need to check a couple of things : 您需要检查以下几件事:

  • where is your public files folder, and if that is writable by the webserver ( in /admin/config/media/file-system ) 您的公共文件文件夹在哪里,并且是否可以由网络服务器写入(在/ admin / config / media / file-system中)
  • where does your working field send files (it might be a different directory), and if it is, use that for the new fields as well. 您的工作字段将文件发送到哪里(它可能是一个不同的目录),如果是,请将其也用于新字段。

Check you file destination directory setting of new image field. 检查新图像字段的文件目标目录设置。 Do not include preceding or trailing slashes. 请勿包含前斜线或后斜线。 This field supports tokens. 该字段支持令牌。 You can also check max, min resolutions, file upload limit, image style (if it is new image style other than thumbnail/ or existing) & number of values ( if it set to 1 you can't upload 2 or more). 您还可以检查最大,最小分辨率,文件上传限制,图像样式(如果是缩略图图像或现有图像以外的新图像样式)和值的数量(如果设置为1,则不能上传2个或更多)。 Finally you have to set it public files type. 最后,您必须将其设置为公共文件类型。

我认为您应该检查文件文件夹的权限。

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

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