public function upload($destinationPath, $publicPath)
    {
        // Move takes the target directory and target filename as params
        $this->getFile()->move($destinationPath, $this->getFile()->getClientOriginalName());

        // Set the path property to the filename where you've saved the file
        $this->path = rtrim(str_ireplace($publicPath, '', $destinationPath), '/').'/'.$this->getFile()->getClientOriginalName();

        // Clean up the file property as you won't need it anymore
        $this->setFile(null);
    }
public function upload($destinationPath, $publicPath)
    {
        // Move takes the target directory and target filename as params
        $this->getFile()->move($destinationPath, $this->getFile()->getClientOriginalName());

        // Set the path property to the filename where you've saved the file
        $this->path = rtrim(str_ireplace($publicPath, '', $destinationPath), '/').'/'.$this->getFile()->getClientOriginalName();

        // Clean up the file property as you won't need it anymore
        $this->setFile(null);
    }
public function upload ( $ destinationPath , $ publicPath ) { // Move takes the target directory and target filename as params $ this -> getFile ( ) -> move ( $ destinationPath , $ this -> getFile ( ) -> getClientOriginalName ( ) ) ; // Set the path property to the filename where you've saved the file $ this -> path = rtrim ( str_ireplace ( $ publicPath , '' , $ destinationPath ) , '/' ) . '/' . $ this -> getFile ( ) -> getClientOriginalName ( ) ; // Clean up the file property as you won't need it anymore $ this -> setFile ( null ) ; }
Manages the copying of the file to the relevant place on the server

@author Vincent Chalamon <vincentchalamon@gmail.com>

@param string $destinationPath Destination path
@param string $publicPath      Public path
Manages the copying of the file to the relevant place on the server