http://groups.google.com/group/symfony-devs/browse_thread/thread/be2b4a3cf9f34ad6/77f422fa1c9ccdd3?hl=fr&lnk=gst&q=feedback#77f422fa1c9ccdd3

Check section related to "protected fields".

See you. COil



----- Message d'origine ----
De : Yuretsz <[EMAIL PROTECTED]>
À : symfony-users@googlegroups.com
Envoyé le : Dimanche, 31 Août 2008, 13h02mn 41s
Objet : [symfony-users] Form optional upload (1.1)


I have a form for propel object.

It has an avatar field, which
is a path to its file. It works great, but I dont want this field to be
updated, when I'm not upload file.
Currently it overwrites old value with an empy record. 

Can anybody tell me what can I do about this?

P.S.
Im handling file upload in actions.php according to the manual

$this->form->bind($
requestFormData, $request->getFiles('profile'));
          if ($this->form->isValid())
          {
               $file = $this->form->getValue('avatar');
               if (!is_null($file)){
                   $filename = 'uploaded_'.sha1($file->getOriginalName());
                   $extension = 
$file->getExtension($file->getOriginalExtension());
                   
$file->save(sfConfig::get('sf_upload_dir').'/'.$filename.$extension);
               }else{
                    
               }
         $profile = $this->form->save();
          }


-- 
============================
Regards...



      
_____________________________________________________________________________ 
Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
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