上傳zip壓縮文件時出現以下錯誤。thumbs.db搞亂我的上傳例程
Warning: ZipArchive::extractTo(C:\xampplite\htdocs\testsite/wp-content/themes/mytheme//styles\mytheme/Thumbs.db) [ziparchive.extractto]: failed to open stream: Permission denied in C:\xampplite\htdocs\testsite\wp-content\themes\mythem\uploader.php on line 17
事情我不能挺數字是我沒有看到無論是在zip壓縮包或已創建(上傳仍然處理目標文件夾中的Thumbs.db文件,我只得到這些錯誤)。
功能是低於17行註釋掉...
function openZip($file_to_open) {
global $target;
$zip = new ZipArchive();
$x = $zip->open($file_to_open);
if($x === true) {
$zip->extractTo($target); //this is line 17
$zip->close();
unlink($file_to_open);
} else {
die("There was a problem. Please try again!");
}
}
C:\ Xampplite文件\ htdocs中\測試網站/可溼性粉劑內容/主題/ mytheme的/ myupgradefile.zip – 2010-03-23 00:51:35
好了,我不知道該怎麼窗戶混合斜槓和反斜槓字符處理路徑,也許一些贏得用戶可以在這裏幫助。 是C:\ xampplite \ htdocs \ testsite/wp-content/themes/mytheme 目錄是否存在?可以apache寫入它嗎? – kodisha 2010-03-23 02:04:24
在PHP中混合斜槓是可以的 – 2010-08-13 17:31:13