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

Frans Saris franssaris at gmail.com
Wed Nov 9 21:45:44 CET 2016


Hi Andreas,

In the extension settings of fal_securedownload  (you find this in the
extension manager) you can set the url that should be called when the
access check fails. If you have some additional access checks in your slot
I guess the easiest way to redirect the user is just to copy the
redirectToUrl() method to your own class.

Just out of curiosity, what additional access check did you add that
fal_securedownload doesn't handle?

Groet Frans

Op ma 7 nov. 2016 21:40 schreef Andreas Haubold <info at andreas-haubold.de>:

> Hello Florian,
>
> thanks a lot for your reply. Sorry that I didn't explained clearly what my
> intention was. The upload worked quite well and I did it in the way you
> explained. The problem was the download where the ext:fal_securedownload
> realy helped out. The only problem left is to redirect the user correctly
> if not authenticated.
>
> For the upload I created a type converter method and a small
> StorageUtility. The type converter is called in the intitializeCreateAction
> of the controller.
>
>  /**
>      * Set type converter configuration
>      *
>      * @param string $argumentName
>      * @return void
>      */
>     protected function
> setTypeConverterConfigurationForImageUpload($argumentName)
>     {
>         $uploadConfiguration = array(
>
> UploadedFileReferenceConverter::CONFIGURATION_ALLOWED_FILE_EXTENSIONS =>
> $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
>             UploadedFileReferenceConverter::CONFIGURATION_UPLOAD_FOLDER =>
> $this->storageUtility->getUploadFolderOfUser(),
>         );
>        [..]
>     }
>
> In the StorageUtility the upload folder of the account the user belongs to
> is resolved.
>
>     /**
>      * Returns the upload folder as string ([storageUid]:/[accountUid],
> e.g. '2:/16')
>      *
>      * @return string
>      */
>     public static function getUploadFolderOfUser()
>     {
>         $settings = ConfigurationService::getPluginSettings();
>
>         return $settings['falStorageUid'] . ':/' .
> self::getFolderIdentifier() . '/';
>     }
>
>     /**
>      * Returns the folder identifier which belongs to a user (the
> accountUid)
>      *
>      * @return int
>      */
>     public static function getFolderIdentifier()
>     {
>         return
> $GLOBALS['TSFE']->fe_user->user['tx_myextension_domain_model_account'];
>     }
>
>
> Best
> Andreas
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev
>



More information about the TYPO3-dev mailing list