1
A
回答
1
$destination_dir = "/foo/bar";
$new_dir = "/foo/bar2";
if (is_dir($destination_dir)) {mkdir($new_dir); $destination_dir = $new_dir;}
$archive = new PclZip($file);
if ($archive->extract(PCLZIP_OPT_PATH, $destination_dir) == 0) {
die("Unzip failed. Error : ".$archive->errorInfo(true));
}
echo "Successfully extracted files to ".$destination_dir;
0
$destination_dir = "/foo/bar";
if (file_exists($destination_dir)) { $destination_dir = "/foo/bar2"; }
mkdir($destination_dir);
$archive = new PclZip($file);
if ($archive->extract(PCLZIP_OPT_PATH, $destination_dir) == 0) {
die("Unzip failed. Error : ".$archive->errorInfo(true));
}
echo "Successfully extracted files to ".$destination_dir;
相关问题
- 1. 如何文件/文件夹移动到一个已经存在的文件夹
- 2. Python的 - 如何处理文件夹创建,如果文件夹已经存在
- 3. 在已经存在的文件夹中创建文件夹
- 4. 子文件夹中的powershell更新文件,如果它已经存在
- 5. 添加一个新的文件夹/文件到已经存在的android项目?
- 6. 如果已经存在具有相同名称的文件夹,则动态更改新文件夹名称
- 7. 检查文件夹已经存在,如果没有在laravel中通过id创建一个新文件夹
- 8. .htaccess - 如果文件不存在,重定向到新文件夹
- 9. PCLZip - 在提取之前是否可以重命名归档文件夹中的文件夹?
- 10. 检查文件名是否已经存在于文件夹中?
- 11. Python - 通过阅读csv文件创建多个文件夹,并检查文件夹是否已经存在,如果没有创建一个新文件夹
- 12. 使用新名称创建文件夹(如果它已存在)
- 13. 如果已经存在,则不要创建文件夹并返回文件夹ID
- 14. '文件夹'已被'文件夹'锁定
- 15. Applescript文件夹操作使文件夹在新文件夹中?
- 16. 提取文件夹中的Zip文件
- 17. 手机已经扎根,但无法从/ data/data文件夹中提取文件
- 18. 如何检查python文件夹中的文件已经改变?
- 19. 基于文件夹的名称已经在Java中存在
- 20. 将文件复制到文件夹(如果存在)+1
- 21. 从Zip Archive中提取存在于文件夹中的文件
- 22. 从带有子文件夹的zip文件夹中提取文件到一个文件夹
- 23. Android/FBReaderJ/gen已经存在,但不是源文件夹。转换为源文件夹或重新命名它
- 24. ZipArchive - 提取文件夹
- 25. 如何将旧文件夹复制到新文件夹并重命名新文件夹中的文件
- 26. 如果文件夹存在,返回true
- 27. 如果文件夹存在与PHP
- 28. 的文件或文件夹的名称已经存在的Visual Studio
- 29. 如何监视新文件或文件夹的文件夹
- 30. 如何递增的文件名,如果文件已经存在