Sorry it was my own mistake in the form template :)

It is working fine ... :D

On Sun, Feb 22, 2009 at 11:33 AM, Sid Bachtiar <[email protected]> wrote:
> Not working no matter what I did.
>
> - I've set persistent-uploads folder to chmod 777
> - I've made sure the form is multipart
>
> But still I did not see any file ended up in persistent-uploads folder.
>
> This is how I use it in my Form class
>
>    $this->setWidgets(
>      array(
>        'photo1' => new pkWidgetFormInputFilePersistent(),
>        'photo2' => new pkWidgetFormInputFilePersistent(),
>        'photo3' => new pkWidgetFormInputFilePersistent(),
>        'photo4' => new pkWidgetFormInputFilePersistent(),
>      )
>    );
>
>    $this->setValidators(
>      array(
>        'photo1' => new pkValidatorFilePersistent(array('required' => true)),
>        'photo2' => new pkValidatorFilePersistent(array('required' => true)),
>        'photo3' => new pkValidatorFilePersistent(array('required' => false)),
>        'photo4' => new pkValidatorFilePersistent(array('required' => false)),
>      )
>    );
>
> I kept getting this:
>
> Notice: Undefined index: persistid in
> .../plugins/pkPersistentFileUploadPlugin/lib/validator/pkValidatorFilePersistent.class.php
> on line 41
>
> On Sun, Feb 22, 2009 at 11:04 AM, Sid Bachtiar <[email protected]> wrote:
>> Hey thank you for this plugin. I will try it soon as I need something
>> like this in one of my projects :)
>>
>> On Sun, Feb 22, 2009 at 10:29 AM, Tom Boutell <[email protected]> wrote:
>>>
>>> The Problem:
>>>
>>> When you make a mistake completing a form, Symfony presents the form
>>> again, with all of your previous selections intact, and points out the
>>> error so that you can painlessly correct it... unless one of the form
>>> fields is a file upload field.
>>>
>>> In that case, you're stuck browsing for the file again and waiting for
>>> it to be uploaded again. And if you don't fix all of your validation
>>> errors on the first try, you may have to do this more than once.
>>>
>>> Symfony's forms framework presents forms to you again with the same
>>> values by setting the value attribute of each input element. However,
>>> for security reasons, web browsers don't honor this when the form
>>> element is a file upload element. (That would allow hackers to create
>>> forms with hidden file upload elements that specified the path to any
>>> file on your hard drive... and actually get that file as a result.
>>>
>>> And even if browsers did allow it, you would still be uploading the
>>> file over and over again. Far from ideal.
>>>
>>> The Solution:
>>>
>>> When you use the pkWidgetFormInputFilePersistent widget class and the
>>> pkValidatorFilePersistent validator class, this problem magically goes
>>> away: file upload fields become persistent through multiple validation
>>> passes. If the user doesn't specifically upload a new file on a later
>>> validation pass, their previous valid upload is simply used again...
>>> without the need to retransmit the file, and without the need for the
>>> user to browse for it again.
>>>
>>> Come check it out:
>>>
>>> http://www.symfony-project.org/plugins/pkPersistentFileUploadPlugin?tab=plugin_readme
>>>
>>> --
>>> Tom Boutell
>>>
>>> www.punkave.com
>>> www.boutell.com
>>>
>>> >>>
>>>
>>
>>
>>
>> --
>> Blue Horn Ltd - System Development
>> http://bluehorn.co.nz
>>
>
>
>
> --
> Blue Horn Ltd - System Development
> http://bluehorn.co.nz
>



-- 
Blue Horn Ltd - System Development
http://bluehorn.co.nz

--~--~---------~--~----~------------~-------~--~----~
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