Unzip Code PHP error -


i have these lines of code upload unzip file. can upload file, cannot unzip it. doing in localhost in meantime. appreciated. thanks. have folders zipfiles , unzipfiles.

//upload file if(isset($_post['submit'])){     $file_path = "zipfiles/";     $name       = $_files['uploaded_file']['name'];       $temp_name  = $_files['uploaded_file']['tmp_name'];       $file_path  = $file_path . basename($name);     $files      = pathinfo($file_path,pathinfo_extension);     $file_type  = $_files['uploaded_file']['type'];      $today = date("y-n-j");        if(move_uploaded_file($temp_name, $file_path)) {         echo "success";         $zip = new ziparchive();         $x = $zip->open($file_path);         if ($x === true) {             $zip->extractto("unzipfiles/");              $zip->close();             }     } else{         echo "fail";     }    } 

i tested code , works.

do have permissions read / write in 2 folders?


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -