一旦我編寫了一個PHP腳本,它應該已經將一些圖像下載到普通的網絡服務器。 出了毛病,這個劇本,現在我有很多的文件與文件大小爲0。一個目錄當我嘗試刪除一個與FileZilla的服務器只回應:無法用Filezilla刪除文件
550 nameOfTheFile.jpg: No file or directory
我該怎麼做擺脫所有這些datatrash?
好像有隻保存在服務器上的文件名,而不是文件
一旦我編寫了一個PHP腳本,它應該已經將一些圖像下載到普通的網絡服務器。 出了毛病,這個劇本,現在我有很多的文件與文件大小爲0。一個目錄當我嘗試刪除一個與FileZilla的服務器只回應:無法用Filezilla刪除文件
550 nameOfTheFile.jpg: No file or directory
我該怎麼做擺脫所有這些datatrash?
好像有隻保存在服務器上的文件名,而不是文件
這裏有一段代碼,我發現here
<?php
$dir_stack = array('test/'); // put the directory to delete here **NOTE** everything in this will be deleted.
$i = 0;
while ($i <= count($dir_stack)-1)
{
echo $dir_stack[$i].'<br>';
if ($dir = opendir($dir_stack[$i]))
{
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && false == is_dir($dir_stack[$i].$file))
{
unlink($dir_stack[$i].$file);
}
elseif ($file != "." && $file != "..")
{
array_push($dir_stack,$dir_stack[$i].$file.'/');
}
}
closedir($dir);
}
$i++;
}
$i = count($dir_stack)-1;
while ($i >= 0)
{
rmdir($dir_stack[$i]);
$i--;
}
?>
這是代碼,我發現,令人驚訝它的工作
<?php
$dir_stack = array('filedirectory'); // put the directory to delete here **NOTE** everything in this will be deleted.
$i = 0;
while ($i <= count($dir_stack)-1)
{
echo $dir_stack[$i].'<br>';
if ($dir = opendir($dir_stack[$i]))
{
while (false !== ($file = readdir($dir)))
{
if ($file != "." && $file != ".." && false == is_dir($dir_stack[$i].$file))
{
unlink($dir_stack[$i].$file);
}
elseif ($file != "." && $file != "..")
{
array_push($dir_stack,$dir_stack[$i].$file.'/');
}
}
closedir($dir);
}
$i++;
}
$i = count($dir_stack)-1;
while ($i >= 0)
{
rmdir($dir_stack[$i]);
$i--;
}
?>
你有shell訪問服務器嗎? – Nick
不,我沒有shell訪問 – frieder
嗯,奇怪的消息。你有沒有嘗試點擊右鍵 - >重新加載(刷新)檢查,如果文件仍然存在? –