色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

服務(wù)器端解壓縮zip的腳本

復(fù)制代碼 代碼如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />  
<title>文件解壓縮管理</title>  
</head>  
<body>  
<?php  
// In php versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead  
// of $_FILES.  
if (isset($_POST["Submit"])) {  
   echo "FileName:     " . $_POST['unpackfile'] . "<br />/n";  
   echo "UnpackPath:   " . $_POST['unpackpath'] . "<br />/n";  
   $zip = zip_open($_POST['unpackfile']);  
   if ($zip) {  
      while ($zip_entry = zip_read($zip)) {  
         echo "Name:               " . zip_entry_name($zip_entry) . "<br />/n";  
         echo "Actual Filesize:    " . zip_entry_filesize($zip_entry) . "<br />/n";  
         echo "Compressed Size:    " . zip_entry_compressedsize($zip_entry) . "<br />/n";  
         echo "Compression Method: " . zip_entry_compressionmethod($zip_entry) . "<br />/n";  

         if (zip_entry_open($zip, $zip_entry, "r")) {  
            $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));   // File content  
            echo "step 1 successful!<br />/n";  
            if(zip_entry_filesize($zip_entry)!=0) {  
               $fp = fopen($_POST['unpackpath']."/".zip_entry_name($zip_entry), 'wb');  
               fwrite($fp, $buf);  
               fclose($fp);  
               zip_entry_close($zip_entry);  
               echo "unpack successful!<br />/n";  
            } else {  
               mkdir($_POST['unpackpath']."/".zip_entry_name($zip_entry), 0777);  
               echo "mkdir successful!<br />/n";  
            }  
         }  
         echo "<br><br>/n/n";  
      }  
      zip_close($zip);  
   }  
?>  
</body>  
</html>  
<?php  
exit();  
}  
?>  
<form id="form1" name="form1" enctype="multipart/form-data" method="post" action="<?=$_SERVER['php_SELF']?>">  
  待解壓文件<input type="text" name="unpackfile" />  
  解壓縮路徑<input type="text" name="unpackpath" />  
  <input type="submit" name="Submit" value="解壓" />  
</form>  
</body>  
</html> 

php技術(shù)服務(wù)器端解壓縮zip的腳本,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 黄石市| 贡嘎县| 双流县| 肇州县| 辽阳市| 石狮市| 唐河县| 岳普湖县| 田林县| 安龙县| 萨嘎县| 青海省| 山阴县| 深水埗区| 册亨县| 扎囊县| 东光县| 常宁市| 盱眙县| 祁阳县| 都安| 香港| 龙江县| 福州市| 怀安县| 多伦县| 正镶白旗| 诸城市| 武安市| 开平市| 威信县| 醴陵市| 昂仁县| 二连浩特市| 嵊泗县| 绩溪县| 文昌市| 德阳市| 高清| 陇南市| 松江区|