tried adding this code, but won't upload any file?

for ( $i = 0; $i <= count('file') - 1; $i++) {
$this->setWidgets(array(
        'file'.[$i] => new sfWidgetFormInputFile(array('label' =>
                                                      'File',)),
      ));

$this->widgetSchema->setNameFormat('website[%s]');

$this->setValidators(array(
        'file'.[$i] => new sfValidatorFile(array('required' => false,
                                             'path'    =>
                  sfConfig::get('sf_upload_dir') . '/directory',
                                             'mime_types' =>array
 ('web_images','audio/mpeg','video/x-ms-wmv','video/x-flv'))) ,
      ));
}


On Nov 3, 6:32 pm, mel_06 <[email protected]> wrote:
> i'm doing a multiple uploads but my problem is i can't set my form
> fields to accept values of more than one?
>
> using the widgets, here is my form
>
> $this->setWidgets(array(
>         'file' => new sfWidgetFormInputFile(array('label' =>
> 'File',)),
>       ));
>
>  $this->widgetSchema->setNameFormat('website[%s]');
>        $this->setValidators(array(
>         'file' => new sfValidatorFile(array('required'          => false,
>                                              'path'        =>
> sfConfig::get('sf_upload_dir') . '/directory',
>                                              'mime_types'  => array
> ('web_images','audio/mpeg','video/x-ms-wmv','video/x-flv'))),
>       ));
>
> i get this error: Cannot use object of type sfValidatedFile.
>
> how can i solve this?
>
> thanks!!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to