微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决重力表单中继器出现上传文件错误

我正在构建一个包含转发器和内部文件上传的表单。当我提交表单时,归档的输入文件总是给我错误上载文件时出错。错误代码: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/

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。