Jump to content
WebFlake

unzip php script


nomorekillz

Recommended Posts

Hey dear community, I started to learn somethings about mysql and php today. Im trying to use a custom url to unzip x file. for example:

http://www.Whateverwebsite.com/uploads/unzip.php?file=FILENAME

The reason of this is because Im using a remote connection from a game to download x files to the server. but I cant find a away to to that. I have found this little code ...

<?php

     $zip = new ZipArchive;
     $res = $zip->open('');
     if ($res === TRUE) {
         $zip->extractTo('');
         $zip->close();
         echo 'ok';
     } else {
         echo 'failed';
     }
?> 

I would like to unzip it in a folder with the same name.

I hope u can help me with this little problem.

Thanks and regards.

Edited by nomorekillz
Link to comment
Share on other sites

  • 2 weeks later...
  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...