php - move uploaded file success but could not find file in folder -


i have following code

public function upload() {     if($_files){         $this->load->model('account/customer');         $file = $_files['profile'];         $file_name = $file['name'];         // $ext = end(explode('.', $file_name));         // $file_name = 'na_'.md5(time()).'.'.$ext;         echo $file_content = $file['tmp_name'];         $data = array('customer_id' => $this->customer->getid(), 'img_url' => $file['name']);         $this->model_account_customer->profileimage($data);         echo 'test/'.$file_name;         $img = move_uploaded_file($file['tmp_name'], 'test/'.$file['name']);         if($img) {             $return = json_encode(array('status' => 1));         } else {             $return = json_encode(array('status' => 0));         }         echo $return;     } } 

the above code returning status 1 not see file in folder. check folder permission 0777

try appending / in front of path

move_uploaded_file($file['tmp_name'], '/test/'.$file['name']); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -