我将.zip扩展名的压缩文件从Android发送到IIS服务器。几乎是工作一切,但我无法用php实现解压缩文件。我有这段代码:
<?php
$target_path1 = "C:/Windows/Temp/";
$target_path1 = $target_path1 . basename( $_FILES['uploaded_file']['name']);
/* I'm making the folder */
$directorio = substr($target_path1, 0, 32);
if (!is_dir($directorio)) {
mkdir($directorio);
}
/* I declare a path */
$barra = "/";
$target_path1 = $directorio . $barra . basename( $_FILES['uploaded_file']['name']);
$target_path2 = $directorio . $barra;
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $target_path1)) {
/* Here I want to unzip the uploaded file */
} else{
echo "There was an error uploading the file, please try again!";
echo "filename: " . basename( $_FILES['uploaded_file']['name']);
echo "target_path: " .$target_path1;
}
?>
那么,我该如何解压缩上传的文件?我尝试了很多方法,但没有人工作。 如果有人可以告诉我要解压缩上传的文件,我将不胜感激。如果我必须在php.ini或IIS服务器中配置一些参数。
提前致谢。