P
P
Petro Boyko2018-04-08 19:37:18
PHP
Petro Boyko, 2018-04-08 19:37:18

How to delete zip file from server?

Hello everyone, tell me how to delete zip rar files from the server ??
I use this code will delete everything except zip rar

if (!isset($_GET['remove'])) die('Не задан файл для удаления');
if (@unlink("archiv/".$_GET['remove']))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shved, 2018-04-08
@shvedan1

Try to eliminate the lack of permissions to delete using the chmod() function
For example:

if (!isset($_GET['remove'])) die('Не задан файл для удаления');
@chmod("archiv/".$_GET['remove'], 0666);
if (@unlink("archiv/".$_GET['remove']))

In order not to guess, try to get a detailed response from the unlink("archiv/".$_GET['remove']) function - enable error output on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question