823 0 0 0
Last Updated : 2024-03-29 12:40:43
Delete previous uploaded image when user uploading a new one for profile picture (as example)
To delete previous uploaded file or image when uploading a new one use this code
$image_path = "images/users/filename.ext"; // you must change filename.ext based on your files in database
if ( File::exists($image_path) ) {
File::delete($image_path);
}