TYPO3以前端形式上传多个文件 [英] TYPO3 upload multiple files in a frontend form

查看:64
本文介绍了TYPO3以前端形式上传多个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 https://github.com/helhum/upload_example 创建一个允许在前端上传文件的表格.单个文件可以正常工作,但我需要上传多个文件.

I'm using the https://github.com/helhum/upload_example to create a form that allow file upload in frontend. It works fine with single file but I would need to upload multiple files.

这是我的表单字段:

<mr:form.upload property="files" id="publication-files-{contentUid}" class="file"
                        data="{loading-text: '{f:translate(key: \'uploading\', extensionName: extKey)}', max-file-size: maxFileSize}"
                        additionalAttributes="{autocomplete: 'off', accept: settings.allowedFiles, multiple: 'multiple'}"/>

请注意,我已经添加了附加属性"multiple".

Note that I've added the addition attribute "multiple".

当我发送表单时,即使我选择了3或4,也总是在UploadedFileReferenceConverter类的convertFrom方法中得到1个文件.

When I send the form I always get 1 file in the convertFrom method of the UploadedFileReferenceConverter class, even if I've chosen 3 or 4...

有人已经尝试过了吗?如果是,请帮助:)

Does someone already experimented that? If yes, please help :)

谢谢

杰里米(Jérémie)

Jérémie

推荐答案

我发现了问题.我不得不像这样使用form.upload ViewHelper的本机多个"参数:

I found the problem. I had to use the native "multiple" argument of form.upload ViewHelper like that :

<mr:form.upload property="files" multiple="multiple" id="publication-files-{contentUid}" class="file"
                        data="{loading-text: '{f:translate(key: \'uploading\', extensionName: extKey)}', max-file-size: maxFileSize}"
                        additionalAttributes="{autocomplete: 'off', accept: settings.allowedFiles}"/>

这篇关于TYPO3以前端形式上传多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆