Hey,
erstmal euch allen ein gesundes neues Jahr!
Ich wollte gerade mal den Upload wie er >>hier<< beschrieben ist ausprobieren.
Habe mir also zuerst mal ein Objekt "Bild" erstellt mit dem DB-Feld "image text NOT NULL".
Im Model sieht das ganze so aus:
<?php
/**
* bild
*
* @var string
*/
protected $bild;
/**
* Returns the bild
*
* @return string $bild
*/
public function getBild() {
return $this->bild;
}
/**
* Sets the bild
*
* @param string $bild
* @return void
*/
public function setBild($bild) {
$this->bild= $bild;
}
?>
...dazu habe ich mir diese Formular angelegt:
<f:form method="post" enctype="multipart/form-data" action="upload" controller="BildUpload" name="bild" object="{bild}">
<f:form.upload property="bild" />
<f:form.submit value="upload" />
</f:form>
...und natürlich die uploadAction:
<?php
/**
* Upload
*
* @param Tx_MyUpload_Domain_Model_Bild $bild
* @return void
*/
public function uploadAction(Tx_MyUpload_Domain_Model_Bild $bild) {
toLog("Upload..." );
$this->view->assign();
?>
Wenn ich nun versuch ein Bild hochzuladen, bekomme ich folgenden Fehler.
#1217839467: Could not ultimately dispatch the request after 101 iterations. Most probably, a @dontvalidate annotation is missing on re-displaying a form with validation errors.
Habe im Formular mal das "f:form.upload" durch ein "f:form.textbox" ersetzt, dann schreibt er mir zumindestens mein Log - das macht er beim ".upload" nicht.
Viele Grüße
Jakob