Uzrakstīju skriptiņu, kas atpako zip arhīvu jaunā direktorijā, bet man izmet
Warning: zip_open() Cannot open zip archive neko_cat.zip in C:\vik\new\galerijas\up.php on line 24
Ir uzliktas vajadzīgās libraries, bet vienalga neiet.
Sistēma: Windows XP, Apache 2.0.52, PHP 4.3.9
<?PHP
if ($_SERVER['QUERY_STRING'] == "") {
?>
<form name="form1" enctype="multipart/form-data" method="post" action="?a=submit"><p><input name="uploadFile" type="file" id="uploadFile" size="60" /><br /></p><p><input type="submit" name="Submit" value="Submit" /></p></form>
<?PHP
}
else {
$file_name = $_FILES['uploadFile']['name'];
$file_name = stripslashes($file_name);
$file_name = str_replace("'","",$file_name);
$copy = copy($_FILES['uploadFile']['tmp_name'],$file_name);
echo $file_name;
if ($copy) {
if ($zip = zip_open($file_name)) {
if ($zip) {
mkdir($file_name);
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip,$zip_entry,"r")) {
$buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
$fp = fopen ($file."/".zip_entry_name($zip_entry),"w");
fwrite($fp,$buf);
zip_entry_close($zip_entry);
}
}
zip_close($zip);
}
}
}
}
?>