[TYPO3-mvc] Images and extbase

Claus Due claus at wildside.dk
Fri Oct 19 11:38:04 CEST 2012


Hi Henjo, 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.

You're damn right about that.

There's another way though, if you use FED.

Inject Tx_Fed_Service_File and use http://fedext.net/services/file.html#autoUpload or its brother, ->getUploadedFiles(), which unlike ->autoUpload() will let you manually move/copy/check files before attaching them to your properties.

Usage would be something like:

public function updateAction($object) {
	if ($this->fileService->autoUpload($object, 'filePropertyName', '/site/relative/base/path') === FALSE) {
		throw new SuperException('These are not the uploads you are looking for', 4815162342);
	}
	… do more stuff to the object that now has files attached at the right properties.
}

Cheers,
Claus


More information about the TYPO3-project-typo3v4mvc mailing list