Hi Lionel,

Anything common with Patrice Fristot ?

..
  ----- Original Message ----- 
  From: Lionel Fristot 
  To: Symfony users 
  Sent: Thursday, February 10, 2011 12:33 PM
  Subject: [symfony-users] Re: How to check if a file exist before uploading it 
?


  Maybe you can try the post-validator way :

  #Add something like that in your Form class

  protected function checkFile()
    {
      $file = $this->getValue('file');//your file input name
      $dir  = $this->getValue('choosen_upload_dir');

      if
        // check if file exists
        // throw an error (or not depending of what you want to do!)

    }

  #and in your setup()
   $this->mergePostValidator(
              new sfValidatorCallback(
                      array('callback' => array($this, 'checkFile'))
              ));

  Hope this helps!

  On 10 fév, 12:18, Manu <emmanuel.parf...@gmail.com> wrote:
  > Nevermind I'll do it in the action before ->save()

  -- 
  If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

  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
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

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
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to