Php thumbs.db打乱了我的上传程序

Php thumbs.db打乱了我的上传程序,php,Php,我在上传zip存档文件时遇到以下错误 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\myt

我在上传zip存档文件时遇到以下错误

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:\xamplite\htdocs\testsite/wp content/themes/mytheme//styles\mytheme/Thumbs.db

我想这可能是windows的问题

你能在第17行上面加一行吗

echo $file_to_open; exit; 
告诉我们当你试图上传文件时它说了些什么?

这条路径全乱了
C:\xamplite\htdocs\testsite/wp content/themes/mytheme//styles\mytheme/Thumbs.db

我想这可能是windows的问题

你能在第17行上面加一行吗

echo $file_to_open; exit; 

并告诉我们当您尝试上载文件时会显示什么?

假设损坏的路径正常工作,则目标目录中有一个thumbs.db(默认为隐藏文件),并且/或者您的脚本没有写入该文件/目录的权限。当一个文件被另一个进程使用时,Windows非常喜欢吐出“权限被拒绝”,而不是说“正在被进程XXX使用”。

假设损坏的路径有效,那么目标目录中有一个thumbs.db(默认为隐藏文件),和/或您的脚本没有写入该文件/目录的权限。当一个文件被另一个进程使用时,Windows非常热衷于吐出“权限被拒绝”,而不是说“正在被进程XXX使用”。

看起来只是一个警告。我会忽略它。我打赌当它试图覆盖extraction目录中的thumbs.db文件时会发生错误

或者,使用
getNameIndex
获取文件列表,过滤thumbs.db,并使用
extractTo
的第二个参数过滤文件


看起来只是一个警告。我会忽略它。我打赌当它试图覆盖extraction目录中的thumbs.db文件时会发生错误

或者,使用
getNameIndex
获取文件列表,过滤thumbs.db,并使用
extractTo
的第二个参数过滤文件


C:\xamplite\htdocs\testsite/wp content/themes/myteme/myupgradefile.zipwell,我不知道windows如何处理斜杠和反斜杠混合字符的路径,也许一些win用户可以在这里提供帮助。是否存在C:\xamplite\htdocs\testsite/wp content/themes/mytheme目录?apache可以写入吗?C:\xamplite\htdocs\testsite/wp content/themes/myheme/myupgradefile.zipwell,我不知道windows如何处理斜杠和反斜杠混合字符的路径,也许一些win用户可以在这里提供帮助。是否存在C:\xamplite\htdocs\testsite/wp content/themes/mytheme目录?apache可以写入它吗?