mirror of https://github.com/itflow-org/itflow
Add check on edit user to see if User directory is created before Avatar upload
This commit is contained in:
parent
3acaf13078
commit
f2ce7a9d8d
4
post.php
4
post.php
|
|
@ -80,6 +80,10 @@ if(isset($_POST['edit_user'])){
|
|||
}
|
||||
$path = strip_tags(mysqli_real_escape_string($mysqli,$_POST['current_avatar_path']));
|
||||
|
||||
if(!file_exists("uploads/users/$user_id")) {
|
||||
mkdir("uploads/users/$user_id");
|
||||
}
|
||||
|
||||
if($_FILES['file']['tmp_name']!='') {
|
||||
//delete old avatar file
|
||||
unlink($path);
|
||||
|
|
|
|||
Loading…
Reference in New Issue