導航:首頁 > 文件處理 > php解壓縮文件

php解壓縮文件

發布時間:2025-02-19 21:56:53

1. 求php壓縮解壓rar和zip類源碼

不用寫,rar演算法是有專利權的

RAR壓縮演算法是RARLab的專利,其它軟體要使用或自己實現RAR演算法的實作,都是要向RARLab申請許可或交錢的

zip演算法php有自帶的函數
====>
需求
PHP 4
The bundled PHP 4 version requires » ZZIPlib, by Guido Draheim, version 0.10.6 or later

PHP 5.2.0 or later
This extension uses the functions of » zlib by Jean-loup Gailly and Mark Adler.
=====>
所以用RAR只有通過命令行調用已經安裝的rar程序實現打包,效果是一樣的.具體調用方法參考各自軟體說明.winrar也能用命令行調用,請看http://ke..com/view/2345.htm

2. 請高手指點:PHP 如何解壓縮zip格式壓縮的文件或壓縮文件夾內的文件到指定目錄

/**
* PHP在線壓縮/解壓實例
*/

date_default_timezone_set('prc');

$zip = new engine_compress_decompress();

if (isset($_POST))
{
$sourcePath = ''; //默認位置

if (isset($_FILES['upfile'])) //上傳文件
{
$stmp = $zip->fileUpload('upfile');
$sourcePath = $stmp['sourcefile'];
$upfileError = $stmp['error'];
}
elseif (isset($_POST['inputfile'])) //輸入目錄或者文件
{
$sourcePath = $_POST['inputfile'];
}
elseif (isset($_POST['decompresssourcefiles'])) //解壓縮提交
{
$isDecompress = $zip->decompress($_POST['decompresssourcefiles'], $_POST['topath']);
if (!empty($isDecompress['filelist']))
{
$href = '<script type="text/javascript" language="javascript">window.location.href=\'#decompress\'</script>';
}

}

$fileList = $zip->fileArray($sourcePath); //解壓縮文件列表

if (isset($_POST['compressinputfileorfolder'])) //壓縮文件目錄或者文件輸入
{
$sourcePath = $_POST['compressinputfileorfolder'];
$href = '<script type="text/javascript" language="javascript">window.location.href=\'#compress\'</script>';
$compressFilelist = $zip->compressFileArray($sourcePath); //壓縮文件列表
}
elseif ((isset($_POST['selectcompressfilelist'])) && (isset($_POST['compresssavefilename'])))
{
$compressFiles = $zip->compress($_POST['selectcompressfilelist'], $_POST['compresssavefilename']); //真實檢測
$isCompress = $zip->CompileZipFile($compressFiles, $zip->savePath, 'all');
if (!empty($isCompress))
{
$href = '<script type="text/javascript" language="javascript">window.location.href=\'#compress\'</script>';
}
}
}

閱讀全文

與php解壓縮文件相關的資料

熱點內容
影城網上售票系統源碼 瀏覽:632
防疫就是命令歌曲 瀏覽:202
滴滴號碼加密怎麼解除 瀏覽:844
模具編程的職責 瀏覽:941
華為ssh改加密演算法 瀏覽:147
文件夾空白合同 瀏覽:761
pythonwebpy開發 瀏覽:669
不是c編譯器的有 瀏覽:660
win10壓縮包下載 瀏覽:905
逆戰手機app怎麼樣 瀏覽:946
自嗨自我解壓圖片 瀏覽:395
電子書導入kindle哪個文件夾 瀏覽:418
pythontcpserver性能 瀏覽:544
linux文件夾改名 瀏覽:564
單片機開發板是什麼 瀏覽:851
阿里雲伺服器不能截屏 瀏覽:866
如何自己製作聯想伺服器 瀏覽:843
停車場規劃演算法 瀏覽:923
深蹲PDF 瀏覽:908
數據科學包python 瀏覽:849