重力表单中继器出现上传文件错误

问题描述

我正在构建一个包含转发器和内部文件上传的表单。当我提交表单时,归档的输入文件总是给我错误:上载文件时出错。错误代码:1 添加

这是我的代码:

  $uploadfiles = GF_Fields::create( array(
    'type'   => 'fileupload','id'     => 1006,// The Field ID must be unique on the form
    'formId' => $form['id'],'multipleFiles' => false,'allowedExtensions' => 'gif,jpg,jpeg,png,txt,rtf,pdf,doc,docx,odt,ppt,pptx,odp,xls,xlsx,ods,xml','description' => '<br>Relevant documents: our transport way bill,probill,photos,etc.<br>Files must be less than 2 MB.<br>Allowed extensions: gif jpg jpeg png txt rtf pdf doc docx odt ppt pptx odp xls xlsx ods xml.','label'  => __('Please attach any relevant document','srx'),'pageNumber'  => 1,// Ensure this is correct
  ));

  // Create a repeater for the team members and add the name and email fields as the fields to display inside the repeater.
  $team = GF_Fields::create( array(
      'type'             => 'repeater','description'      => '','id'               => 1000,// The Field ID must be unique on the form
      'formId'           => $form['id'],'label'            => __('Products','addButtonText'    => __('Add product','removeButtonText' => __('Remove product','maxItems'         => 100,// Optional
      'pageNumber'       => 1,// Ensure this is correct
      'fields'           => array( $reference,$quantity,$product,$lista,$uploadfiles ),// Add the fields here.
  ) );

即使不需要该字段,无论如何都会给我错误。 我的另一个问题是有关使用MultipleFiles = true。这根本不起作用。知道为什么吗?

非常感谢您!

解决方法

Repeater API当前不支持“文件上传”字段。以下是已知限制的完整列表:

https://docs.gravityforms.com/repeater-fields/#limitations

如果您需要重复上传文件,请查看重力表格嵌套表格:

https://gravitywiz.com/documentation/gravity-forms-nested-forms/

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...