(please specify the URL of the site on which you are experiencing the problem) sebul.sarang.net
I upload many files to server with filezilla. diretory name is w.
Now I want these files.
I try deleting these files with filezilla. But it takes a lot of time.
How can delete many files quickly?
Is there another tool?
For example ssh etc…
@chiucs123
Thank your comment.
i want delete sebul.sarang.net/w/ directory.
I try this work with filezilla but speed is not fast.
How can use php script? Detail please…
<?php
error_reporting(E_ALL);
header('content-type: text/plain');
function getFilesAndFolders($directory = '.') {
$allFiles = [];
$allFolders = [];
// Iterate over the contents of the directory
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory)) as $item) {
// Skip '.' and '..' directories
$basename = $item->getBasename();
if ($item->isDir() || in_array($basename, ['.', '..'], true)) {
if($basename === '.'){
$allFolders[] = rtrim($item->getPathname(), '.');
}
} elseif ($item->isFile()) {
$allFiles[] = $item->getPathname();
}
}
return ['files' => $allFiles, 'folders' => $allFolders];
}
// Replace '.' with the path of the directory you want to start from
$result = getFilesAndFolders(__DIR__);
echo "All Files:\n";
print_r($result['files']);
foreach($result['files'] as $file){
if(file_exists($file)){
unlink($file);
}
}
echo "\nAll Folders:\n";
print_r($result['folders']);
Then place this file in the w directory, and visit your website by referencing this file, for example, sebul.sarang.net/w/nuker.php, and all your files are gone by the time you see a list of files.
And yes, the nuker.php file is in that folder, so it also self-descruts. However because I’m too lazy, the only thing left for you to delete are the folders, which can be easily removed and deleted in FileZilla quickly.