[TYPO3-dev] Re: Howto define processedFiles folder for each feuser within extension

Florian Rival florian.typo3 at oktopuce.fr
Mon Nov 7 11:43:23 CET 2016


Hi Andreas,

If you want to change the upload folder, you can do it in the 'initializeCreateAction' function :

public function initializeCreateAction() {
        $mediaUploadConfiguration = array(
            UploadedFileReferenceConverter::CONFIGURATION_ALLOWED_FILE_EXTENSIONS => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
            UploadedFileReferenceConverter::CONFIGURATION_UPLOAD_FOLDER => $this->settings['imagesFolder'],
      );
      ...
}

        // Define conversion to file reference for image
        $newArticleConfiguration->forProperty('image')
            ->setTypeConverterOptions(
                'Vendor\\MyExt\\Property\\TypeConverter\\UploadedFileReferenceConverter',
                $mediaUploadConfiguration
            );

in the above example, the folder comes from TS ($this->settings['imagesFolder']) : 

plugin.tx_myext_myPlugin.settings {
    # Folder for images
    imagesFolder = 5:/user_upload/
}

but you can also use fe user uid :

$GLOBALS['TSFE']->fe_user->user['uid']

Florian
-- 
-- Florian Rival --
www.oktopuce.fr



More information about the TYPO3-dev mailing list