Ian wrote:
> It looks as if this post solved my problem:
> http://www.symfony-project.org/forum/index.php/m/49877/?srch=sfValidatorFile#msg_49877
>
> Had to change this (line 316):
> public function __toString()
> {
> return $this->savedName;
> }
>
> To this:
>
> public function __toString()
> {
> return $this->getOriginalName();
> }
>
>
> Maybe a bug?
No, the __toString() method must returns the saved name.
I've added a check to be sure that the __toString() method always return
a string.
Fabien
>
>
> Slick Rick wrote:
>> So I'm trying to upload files and save them to the server...
>>
>> In my form I have:
>>
>> $this->setValidatorSchema(
>> new sfValidatorSchema(array(
>> 'image' => new sfValidatorFile(array('required' => false,
>> 'mime_categories' => 'web_images')),
>> ),
>> array('allow_extra_fields' => true)
>> ));
>>
>> After I post the form, it passes the isValid() check and I can see the file
>> data listed by $this->getRequest()->getFiles('product');
>>
>> Now, When I try to $form->getValue('image'), I get the following error:
>>
>> Catchable fatal error: Method sfValidatedFile::__toString() must return a
>> string value in /path/to/module/actions/actions.class.php on line 265
>>
>> If I do $form['image']->getValue(), I get nothing, just empty.
>>
>> What it looks like I am trying to do is get an instance of sfValidatedFile()
>> so I can procede with the save() method. Is there a bug in the system, or
>> am I doing it wrong?
>>
>> Thanks,
>>
>> --ian
> >
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---