2
#1
UnZIP a .ZIP file on your server remotely (PHP 5.2+)
Posted March 16th 2012, 12:20am
Here's a little thing I wrote a while ago that you may find useful.

It can be a real pain to download a ZIP file, then be forced to unZIP it locally and use FTP to upload all the individual files. Well, if you have PHP 5.2 or greater, and your host has installed the ZIP extension, then you can upload the ZIP file to your server, and use this short program to unZIP the files to the location of your choice! Here's the program, which I will call unzip.php:

Please log in to view this content.

To use the program upload the ZIP file (which we will call sample.zip) to the same directory where unzip.php resides (for this example, the root directory). Then, from your browser, enter this URL:

http://yoursite.com/unzip.php?f=sample.zip&l=/newzip

The sample.zip file will be unZIPped into the /newzip directory. If you don't specify a destination directory, the ZIP file will be unZIPped into the /zip directory.

I hope this saves you some time. And if anyone decides to improve on the program, I would appreciate your sharing it here!
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
2
#2
UnZIP a .ZIP file on your server remotely (PHP 5.2+)
Posted March 16th 2012, 12:28pm
Hmm thanks for that.

Here's a quick file uploading application, which allows for uploading of multiple files. It includes the Zip File code provided by Dion above. You can also specify a new directory to upload to and it will be created.

I didn't test it so if anyone spots any reasons why it won't work please say. :P


Please log in to view this content.
φ
Posts: 509
Joined: July 9th 2011, 11:00pm
Location: England
Likes Given: 15
Likes Received: 26
1
#3
UnZIP a .ZIP file on your server remotely (PHP 5.2+)
Posted March 16th 2012, 3:58pm
Those are nice additions to the script! Since it was for personal use, I never bothered to add a front-end interface. Your additions make it much more useful for other users.
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 1 guest