Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP how to skip file upload if file already exist

if(isset($_FILES["user_image"]) && (int)$_FILES["user_image"]['error']===0)
{
    $extension = explode('.', $_FILES['user_image']['name']);
    $new_name = rand() . '.' . $extension[1];
    $destination = '../upload/' . $new_name;
    move_uploaded_file($_FILES['user_image']['tmp_name'], $destination);
    return $new_name;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #PHP #skip #file #upload #file #exist
ADD COMMENT
Topic
Name
9+7 =