dev-resources.site
for different kinds of informations.
How to delete a file uploaded in database
Published at
5/2/2020
Categories
sql
mysqli
mysql
data
Author
Julian
To delete a file loaded on a server, we must enter the following code in our program:
// We proceed to delete
if (! unlink ('uploads /'.$ file)) {
// print error when deleting
echo 'Error deleting';
} else {
// File deleted
echo 'File deleted';
}
Featured ones: