Révision cf314c59 www/extract.php
www/extract.php | ||
---|---|---|
3 | 3 |
//GNU/GPL |
4 | 4 |
print "<pre>"; |
5 | 5 |
require_once("zip/pclzip.lib.php"); |
6 |
if($_GET['src'] != "" && $_GET['dst'] != "") {
|
|
6 |
if($_GET['src'] != "") { |
|
7 | 7 |
$base = getcwd() . "/"; |
8 | 8 |
print "on est ici : " . getcwd() . "\n"; |
9 |
print "on essaye de decompresser " . $_GET['src'] . " vers " . $_GET['dst'] . "\n";
|
|
9 |
print "on essaye de decompresser " . $base . $_GET['src'];
|
|
10 | 10 |
if(file_exists($base . $_GET['src'])) { |
11 | 11 |
$archive = new PclZip($base . $_GET['src']); |
12 |
//src=galleries/Cala-Montjoi-2012_Christophe/zip/mq.zip |
|
13 |
//et nous on extrait dans galleries/Cala-Montjoi-2012_Christophe/mq |
|
14 |
$dstRep = basename($_GET['src'],".zip"); |
|
15 |
$dst = dirname(dirname($base . $_GET['src'])) . "/" . $dstRep; |
|
16 |
print " vers $dst\n"; |
|
17 |
|
|
12 | 18 |
//Extrait dans le repertoire courant. |
13 |
if(is_dir($base . $_GET['dst'])) {
|
|
14 |
chdir($base . $_GET['dst']);
|
|
19 |
if(is_dir($dst)) {
|
|
20 |
chdir($dst);
|
|
15 | 21 |
$list = $archive->extract(); |
16 | 22 |
if($list == 0) { |
17 | 23 |
die("Error : ".$archive->errorInfo(true)); |
Formats disponibles : Unified diff