[TYPO3-mvc] Images and extbase

mario chiari m at mariochiari.net
Sat Oct 20 10:48:55 CEST 2012


Hi Henjo,


thanks so much, it works!!
I define:

	public function createAction(Tx_Crono_Domain_Model_Crono $newCrono) {
               if ($_FILES['tx_crono_crono']) {
	$basicFileFunctions = t3lib_div::makeInstance('t3lib_basicFileFunctions');
	$fileName =
$basicFileFunctions->getUniqueName($_FILES['tx_crono_crono']['name']['newCrono']['logo'],t3lib_div::getFileAbsFileName('uploads/tx_crono/'));
	t3lib_div::upload_copy_move($_FILES['tx_crono_crono']['tmp_name']['newCrono']['logo'],$fileName);
	$newCrono->setLogo(basename($fileName));
	}
	$this->cronoRepository->add($newCrono);
	$this->flashMessageContainer->add('Your new Crono was created.');
	$this->redirect('index'); 
	}

cheers
mario

On Fri, 2012-10-19 at 11:30 +0200, Henjo Hoeksma wrote:
> Hi Mario,
> 
> the annotation is fine.
> 
> The whole message you receive is because extbase doesn't handle file
uploads out of the box, you need to write support for that in your
controller.
> 
...




More information about the TYPO3-project-typo3v4mvc mailing list