reenadak

unzip files at server

Sep 25th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. echo "<p>Using code below, files can be unzipped to a different destination directory.<p>";
  2. echo "<h3>Unzip PHP Files</h3>";
  3.  
  4. highlight_string("
  5. <?php
  6. $zip = new ZipArchive;
  7. if ($zip->open('dak.zip') === TRUE) {
  8. $zip->extractTo('dest/d1/');
  9. $zip->close();
  10. echo 'ok';
  11. } else {
  12. echo 'failed';
  13. }
  14. ?>
  15. ");
  16.  
  17. echo "<p>Using code below, files can be unzipped to the same destination directory.<p>";
  18.  
  19. highlight_string('
  20. <?php
  21. if(system("unzip thesis_18.zip"))
  22. {
  23. echo "<p>Files unzipped successfully<p>";
  24.  
  25. } else {
  26. echo "<p>Sorry, Files could not be unzipped!<p>";
  27.  
  28. }
  29. ?>
  30. ');
Add Comment
Please, Sign In to add comment