2

Is it possible to set an uploadfolder in TCA for a field (type FAL)?

I thought that is either possible by setting a relative path to "my" filestorage or by setting a filestorage-ID to the TCA-element.

Currently all files are stored in fileadmin/user_upload.

This is the current config in my extensions TCA:

'fieldname' => array(
        'exclude' => 1,
        'label' => '...',
        'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('image',
                array(
                        'appearance' => array(                                  
                                'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference'
                        ),
                        // custom configuration for displaying fields in the overlay/reference table
                        // to use the imageoverlayPalette instead of the basicoverlayPalette
                        'foreign_types' => array(
                                '0' => array(
                                        'showitem' => '
                                                --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                                                --palette--;;filePalette'
                                ),
                                \TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => array(
                                        'showitem' => '
                                                --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                                                --palette--;;filePalette'
                                ),
                        )
                ),
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
        )
    ),
simonhard
  • 29
  • 2
  • TCA ref suggests to set the folder with userTS `options.defaultUploadFolder = 2:user_folders/my_folder/` https://docs.typo3.org/typo3cms/TSconfigReference/UserTsconfig/Options.html#defaultuploadfolder However this would not work on a more granular level – stmllr Jan 29 '19 at 09:19

1 Answers1

0

Can be achieved with extension EXT:default_upload_folder

Allows to configure the folder on table or field level via pageTs settings. See extension documentation

stmllr
  • 652
  • 3
  • 18