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

Andreas Haubold info at andreas-haubold.de
Sat Sep 10 09:42:03 CEST 2016


Hello TYPO3 community!

After working through Helmut Hummels upload example (github.com/helhum/upload_example) I got it working under TYPO3 7.6 and trying to customize the upload for a project.

The goal is to have feusers upload their files to a specific user folder within the file storage of the extension. The file storage record of the extension has uid=2 and is located in /uploads/tx_myextension, the feuser belongs to an account which has e.g. the accountUid=16. So the upload folder of the user might be '2:/16' which points to '/uploads/tx_myextension/16/'. The upload to this folder works fine.

1.) The first question is about how to show images/files only for logged in users. Images are rendered with index.php?eID=dumpFile... and I didn't found any approach how to implement a permission check before the image is rendered (e.g. by using a slot). Users should only have access to images of the account to which they have access. 

2.) My second question is about how to handle proccessed images correctly. Currently all proccessed files are located within /uploads/tx_myextension/_processed_/ The better way would be to have all files within the account folder ('/uploads/tx_myextension/16/_processed_') of each user. So if an account will be deleted all images and processed images will be removed easily also.
Is there a way to override the processingFolder of a storageRecord for each logged in user? I only found the getProcessingFolder() method within \TYPO3\CMS\Core\Resource\ResourceStorage but no setter method.

Thank you very much for any help!

Andreas



More information about the TYPO3-dev mailing list