導航:首頁 > 文件處理 > 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解壓縮文件相關的資料

熱點內容
程序員放棄後會怎樣 瀏覽:188
河北模具編程 瀏覽:190
adb查找命令 瀏覽:324
安卓手機視頻文件夾怎麼打開 瀏覽:314
平板加密手機後怎麼關閉 瀏覽:572
流媒體伺服器應該注意什麼 瀏覽:539
d8命令編譯 瀏覽:969
壓縮包解壓需要多少空間 瀏覽:152
如何查找app屬性 瀏覽:392
android人臉識別技術 瀏覽:327
pc104編程 瀏覽:338
二維碼反編譯破解推廣 瀏覽:686
修改伺服器的mac地址 瀏覽:531
好玩的編程軟體 瀏覽:903
編程語言創始人有錢嗎 瀏覽:809
短視頻app怎麼獲客 瀏覽:18
查看雲伺服器的應用 瀏覽:441
javadump工具 瀏覽:569
程序員16g 瀏覽:449
程序員沒有辦法成為top怎麼辦 瀏覽:224