[TYPO3-mvc] Validation Error File Upload

Sören Kracker s.kracker at kopfstand-mail.de
Fri Sep 9 10:17:10 CEST 2011


It seems that the file upload is denied. $_FILES is empty after submit 
and file input gets class f3-form-error. Don't get it why that happens. 
Normal file upload via fileadmin works.

My form:
<f:form enctype="multipart/form-data" method="post" action="create" 
name="newCatalog" object="{newCatalog}">
My input:
<f:form.upload property="filename" />
My submit:
<f:form.submit value="Create new" />

Anybody can help?

> Hello,
> I always get this error when submitting a form with file upload in 
> backend:
>
> An error occurred while trying to call 
> Tx_Placeholder_Controller_CatalogController->createAction()
> 1245107351: Validation errors for argument "newCatalog"
> newCatalog: Validation errors for property "filename"
>
> But I haven't set any validation for the filename except NotEmpty but 
> I select a file, so it shouldn't be empty. Does anybody have an idea 
> what's going wrong? Maybe debugging hints too? I'm new to extbase/fluid.
>
> Controller:
> /**
>      * action create
>      *
>      * @param  $newCatalog
>      * @return string The rendered create action
>      */
>     public function createAction(Tx_Placeholder_Domain_Model_Catalog 
> $newCatalog) {
>         ...
>     }
>
> TCA:
> 'filename' => array(
>             'exclude' => 0,
>             'label' => 'filename',
>             'config' => array(
>                 'type' => 'group',
>                 'internal_type' => 'file',
>                 'uploadfolder' => 'uploads/tx_placeholder',
>                 'allowed' => '*',
>                 'disallowed' => 'php',
>                 'size' => 1,
>             ),
>         ),
>
> Model:
> /**
>      * filename
>      *
>      * @var string
>      * @validate NotEmpty
>      */
>     protected $filename;
>
> /**
>      * Returns the filename
>      *
>      * @return string $filename
>      */
>     public function getFilename() {
>         return $this->filename;
>     }
>
>     /**
>      * Sets the filename
>      *
>      * @param string $filename
>      * @return void
>      */
>     public function setFilename($filename) {
>         $this->filename = $filename;
>     }
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc


More information about the TYPO3-project-typo3v4mvc mailing list