TYPO3 8 form - Define several file upload folders

自作多情 提交于 2021-01-29 15:08:37

问题


I want to define different upload folders in the TYPO3 form extension. Following the example in the manual (https://docs.typo3.org/c/typo3/cms-form/8.7/en-us/Concepts/FormFileStorages/Index.html) I tried the below configuration. In the form wizzard I can select the different folders. The two folders fileadmin/myfolder/folder1/ and fileadmin/myfolder/folder2/ exist, but in the frontend I get the error that the folder /myfolder/folder1/ does not exist. What am I doing wrong?

TYPO3:
CMS:
Form:
  persistenceManager:
    allowedFileMounts:
      20: 1:/myfolder/folder1/
      21: 2:/myfolder/folder2/
  prototypes:
    standard:
      formElementsDefinition:
        FileUpload:
          formEditor:
            predefinedDefaults:
              properties:
                saveToFileMount: '1:/myfolder/folder1/'
                saveToFileMount: '2:/myfolder/folder2/'
            editors:
              400:
                selectOptions:
                  10:
                    value: '1:/myfolder/folder1/'
                    label: '1:/myfolder/folder1/'
                  20:
                    value: '2:/myfolder/folder2/'
                    label: '2:/myfolder/folder2/'
          properties:
            saveToFileMount: '1:/myfolder/folder1/'
            saveToFileMount: '2:/myfolder/folder2/'
        Form:
          renderingOptions:
            templateRootPaths:
              20: 'EXT:myext/Resources/Private/Templates/Extensions/form/Templates/'
            partialRootPaths:
              20: 'EXT:myext/Resources/Private/Templates/Extensions/form/Partials/'

回答1:


This configuration works:

TYPO3:
  CMS:
    Form:
      persistenceManager:
        allowedFileMounts:
          10: 1:/myfolder/
      prototypes:
        standard:
          formElementsDefinition:
            FileUpload:
              formEditor:
                predefinedDefaults:
                editors:
                  400:
                    selectOptions:
                      10:
                        value: '1:/myfolder/folder1/'
                        label: '1:/myfolder/folder1'
                      20:
                        value: '1:/myfolder/folder2/'
                        label: '1:/myfolder/folder2/'
              properties:
                saveToFileMount: '1:/myfolder/'


来源:https://stackoverflow.com/questions/64935200/typo3-8-form-define-several-file-upload-folders

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!