File upload not working in oops php : public function upload($file=array(),$where){
		

		if (file_exists($this->src.$file['name']))
	      {
			
            $data['error'] = "Sorry, file already exists.";
          }
		  elseif($file["name"]["size"] > 500000) {
             $data['error'] = "Sorry, your file is too large.";
            
         }
		  
		elseif(is_array($file))
		  {
				
			
			if(in_array($file['type'],$this->type))
			{
				  
				$filePath = $this->src.$file['name'];
				
				$file_Check = move_uploaded_file($file['name']['tmp_name'], $filePath);
				if($file_Check )
			    {
				print_r($file); die(); 
				$name = $file['name'];
				//$this->update(array('photo'=>$name,'candi_id'=>$where));
			    }
				
				$data['error'] = 'File has been uploaded';
			}
			else
			{
				$data['error'] = 'File formet was not supported';
			}
		}
		else
		{
			$data['error'] = 'No File was uploaded...';
			
		}
		
		return $data;
       
    }
output:

file path show correctly.function also working fine but file not move to folder?


file path show correctly.function also working fine but file not move to folder?


