I have a problem in image unlink in Internet Explorer, but it works in Mozilla.
I have used php code:
<?php
unlink("./product_photos/".$name);
?>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP is not affected by browser quirks.
If
unlink()is failing, it probably has to do with your PHP. Does the file path point to a file? What doesvar_dump(file_exists("./product_photos/".$name));say before deleting it? If it isn’t(bool) true, there is your problem 🙂Be also sure that
$nameis sanitized if it is from the user, otherwise I may enter../../../your-site/index.php(a directory traversal attack).