PERL 61
Unzip_v1 Guest on 22nd July 2020 08:54:38 PM
  1. #!/usr/bin/perl
  2. ############################################
  3. # Remote unZip Utility © 2002 by Robert Wedge
  4. # [email protected] Use this to retrieve and
  5. # open .zip files into your directory.
  6. # Uses CGI.pm and LWP::Simple modules.
  7. # Chmod script to 755
  8. ############################################
  9. use CGI;
  10. $q = new CGI;
  11. $url = $q->param('url');
  12. $effects = 'nohighlight autoactivate onBlur=spud()';
  13. $effect = 'nohighlight autoactivate';
  14. if ($url eq '' )  {
  15. print $q->header;
  16. print $q->start_html
  17.                   (-title=>'File Unzip',
  18.                    -bgcolor=>'white',
  19.                    -text=>'navy',
  20.                    -vspace=>'60',
  21.                    -hspace=>'30',
  22.                    -onLoad=>'PutRef()');
  23. <script language=JavaScript>
  24. function PutRef () {
  25. var his = (navigator.appCodeName == 'bowser' ) ? history.previous: document.referrer;
  26. if ( his.indexOf(\"http://\") != 0 ) { his = \"http://\" }
  27. document.f.url.value=his;
  28. }
  29. function spud() {
  30. ext = document.f.url.value;
  31. parts = ext.split(\"/\");
  32. a = (parts.length);
  33. b = (a - 1);
  34. document.f.fname.value=(parts[b]);
  35. }
  36. </script>";
  37. print "<center><h3><b>Enter the .zip file url</b></h3>";
  38. print $q->startform
  39.                    (-name=>'f',
  40.                     -method=>'post');
  41. print "<br>Url ". $q->textfield
  42.                    (-name=>'url',
  43.                     -default=>'http://',
  44.                     -size=>'50',
  45.                     -$effects);
  46. print "<br>File Name ". $q->textfield
  47.                    (-name=>'fname',
  48.                     -default=>'',
  49.                     -size=>'25',
  50.                     -$effect);
  51. print $q->submit(-value=>'UnZip');
  52. print $q->endform;
  53. print "<p><font size=\"-2\">© 2002 expanding head</font>";
  54. print "</center>";
  55. print $q->end_html;
  56. }
  57. else {
  58. use LWP::Simple;
  59. $fname = $q->param("fname");
  60. if ( $fname eq '') { $fname = "temp.zip"; }
  61. $file = getstore("$url","$fname") or die "Could not resolve $url: $!";
  62. $Results = `unzip $fname; ls $fname 2>&1`;
  63.  
  64. print $q->header;
  65. print $q->start_html
  66.                   (-title=>'File Unzip',
  67.                    -bgcolor=>'white',
  68.                    -text=>'navy',
  69.                    -vspace=>'30',
  70.                    -hspace=>'30');
  71. print "<center>";
  72. print "<p><h3><b>File Status</b></h3>";
  73. print "<p>Zip file = $fname";
  74. print "<p>$Results<br><b>End of Action</b>";
  75. print "<p><font size=\"-2\">© 2002 expanding head</font>";
  76. print "</center>";
  77. print $q->end_html;
  78. }

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.