public function upload(UploadedFile $file = null)
    {
        if ($file === null) {
            return '';
        }

        $fileName = $this->getFileName($file);
        $file->move($this->getTargetDir(), $fileName);

        return $fileName;
    }
public function upload(UploadedFile $file = null)
    {
        if ($file === null) {
            return '';
        }

        $fileName = $this->getFileName($file);
        $file->move($this->getTargetDir(), $fileName);

        return $fileName;
    }
public function upload ( UploadedFile $ file = null ) { if ( $ file === null ) { return '' ; } $ fileName = $ this -> getFileName ( $ file ) ; $ file -> move ( $ this -> getTargetDir ( ) , $ fileName ) ; return $ fileName ; }
Upload file on server

@param UploadedFile|null $file

@return string
Upload file on server