I try this..but not create the subfolder…i don’t understant where is the problem..
$user_id = $this->User->id;
if(!empty($prof_image['name'])){
$image_name = str_replace($prof_image['name'], 'profile', $prof_image['name']);
$dest = WWW_ROOT . DS . 'img' . DS . 'filocity_img' . DS . 'user_'. $user_id . DS . $image_name . '.jpg';
if(move_uploaded_file($prof_image['tmp_name'], $dest)){
echo json_encode('Information successfully updated');
}
}
can anyone help me? Thanks in advance.
You can do it easily using CakePHP file and folder utility.
At first add:
Then try this :