guys,,need help :(

I cannot upload file using this script

if($_FILES["zip_file"]["name"]) {
 $filename = $_FILES["zip_file"]["name"];
 $source = $_FILES["zip_file"]["tmp_name"];
 $type = $_FILES["zip_file"]["type"];
 $name = explode(".", $filename);
 $accepted_types = array('application/zip', 'application/x-zip', 'application/x-zip-compressed', 'application/octet-stream', 'multipart/x-zip', 'application/x-compressed');
 foreach($accepted_types as $mime_type) {
  if($mime_type == $type) {
   $okay = true;
 $continue = strtolower($name[1]) == 'zip' ? true : false;
 if(!$continue) {
  $message = "The file you are trying to upload is not a .zip file. Please try again.";
 $target_path = "/upload/".$filename;  // change this to the correct site path
 if(move_uploaded_file($source, $target_path)) {
  $zip = new ZipArchive();
  $x = $zip->open($target_path);
  //Unpacking Zip file
  //if ($x === true) {
   //$zip->extractTo(" "); // change this to the correct site path
  $message = "Your .zip file was uploaded and unpacked.";
 } else { 
  $message = "There was a problem with the upload. Please try again.";
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<?php if($message) echo "<p>$message</p>"; ?>
<form enctype="multipart/form-data" method="post" action="">
<label>Choose a zip file to upload: <input type="file" name="zip_file" /></label>
<br />
<input type="submit" name="submit" value="Upload" />

I already set permission on that folder in php.ini but still no luck.


please help

Why are you using php.ini to set permission - you should do that using CHMOD in your file manager.

some thread recommends it. anyway chmod do the job for me and setting the upload folder outside www folder.

thanks simplypixie