2017-09-12 7 views
1

https://github.com/helhum/upload_example을 사용하여 프론트 엔드에서 파일을 업로드 할 수있는 양식을 만듭니다. 그것은 하나의 파일로 잘 작동하지만 여러 파일을 업로드해야합니다. 나는 또한 속성 "복수"를 추가 한TYPO3 프론트 엔드 형식으로 여러 파일 업로드

<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'}"/> 

참고 :

그래서 여기 내 양식 필드입니다.

나는 항상 내가 3 또는 4를 선택한 경우에도 UploadedFileReferenceConverter 클래스의 convertFrom 방법 (1 개) 파일을 가져 양식을 보내 ...

사람은 이미 그 실험을합니까? 예, :)

감사합니다,

제레미를 도와주십시오

+0

을, 당신은 https://github.com/helhum/upload_example/pull 여기에서 새로운 지원에 대한 변경 로그를 찾을 수 있습니다/10/파일. 다음은 다중 파일 업로드에 대한 완전한 확장입니다 https://github.com/GhanshyamBhava/socioz –

답변

0

속성에서 .0를 제거합니다. 이것은 말합니다 : 도메인 모델 속성 "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'}"/> 
+0

이렇게하면 속성 경로 "files.name"에서 속성을 매핑하는 동안 예외가 발생합니다 : ID 속성 "my_file_name.png "UID가 없다." – StatiX

2

가 나는 문제를 발견했다. 나는 그런 form.upload ViewHelper의 기본 "여러"인수를 사용했다 : 여기

<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}"/>