我从这个答案中找到了将 Multiupload Filefield Widget 添加到我的自定义表单中的方法,https: //drupal.stackexchange.com/questions/90637/does-multiupload-filefield-widget-for-drupal-provides-a-form- api-element/90658#90658?newreg=8dba9580e3d74b4d8b2cd1b140a4f08d
在表单中添加多文件上传字段后,我尝试上传一些文件,加载栏消失后它不会显示上传文件列表。
以下是我在表单中声明该字段的方式:
$form['downloadsformset'] = array(
'#type' => 'fieldset',
'#title' => t('Downloads'),
'#collapsible' => TRUE,
'#group' => 'myform'
);
$form['downloadsformset']['download_items'] = array(
'#type' => 'mfw_managed_file',
'#title' => t('Download items'),
'#description' => t('You are allow to upload jpg, jpeg, png and gif'),
'#progress_indicator' => 'bar',
'#upload_location' => "public://dev/tmp",
"#upload_validators" => array(
"file_validate_extensions" => array("png jpg jpeg"),
'file_validate_size' => array(1024*1024*1024),
),
'#group' => 'myform'
);
为了显示上传的文件列表,我错过了什么?