Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * file
- *
- * @var TYPO3CMSExtbaseDomainModelFileReference
- */
- protected $file = null;
- /**
- * Returns the file
- *
- * @return TYPO3CMSExtbaseDomainModelFileReference $file
- */
- public function getFile()
- {
- return $this->file;
- }
- /**
- * Sets the file
- *
- * @param TYPO3CMSExtbaseDomainModelFileReference $file
- * @return void
- */
- public function setFile(TYPO3CMSExtbaseDomainModelFileReference $file)
- {
- $this->file = $file;
- }
- <f:form.upload property="file" />
- /**
- *action initialise
- *
- *@return void
- */
- public function initializeAction() {
- $this->controllerContext = $this->buildControllerContext();
- $arg = $this->request->hasArgument('newFile') ? 'newFile' : 'file';
- if (isset($this->arguments[$arg])) {
- $uploadConfiguration = array(
- UploadedFileReferenceConverter::CONFIGURATION_ALLOWED_FILE_EXTENSIONS => 'jpg,jpeg,html,css,html,png,bmp,txt,doc,docx,xlf,ico,gif,ogg,tiff',
- UploadedFileReferenceConverter::CONFIGURATION_UPLOAD_FOLDER => 'uploads/tx_pitsbannermanagement',
- );
- /** @var PropertyMappingConfiguration $newFileConfiguration */
- $newFileConfiguration = $this->arguments[$arg]->getPropertyMappingConfiguration();
- $newFileConfiguration->forProperty('file')->setTypeConverterOptions('vendor\Extension\Property\Typeconverter\UploadedFileReferenceConverter',$uploadConfiguration);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement