Dec
29
PHP - Unzip File from Browser
December 29, 2007 |
I won’t pretend to be an expert, but I thought I’d save the next person the grief of going through the SSH dramas again. Many people who have experience upload an entire site from localhost to remote server knows it really really take a while to upload a gazillion files at once. Professionals use SSH clients to do this task. They first zip all the files up, upload through FTP (which is much faster than upload an uncompressed folder), and unzip it using SSH client. But if you are one of the folks who is new to IT and just want a quick and dirty way to do it without knowing what the heck is SSH. Here is a quick and dirty way for you. Step 1: Write a PHP file called unzip.php with the following line of code in it (yes, you hear me right, only one line of code) : exec(”unzip myentiresite.zip”); Step 2: After you have created the unzip.php, zip your entire site up, and name it myentiresite.zip or whatever name you want that correspond to the file name in the PHP file. Step 3: Now upload both the ZIP file and the unzip.php file to the remote server. Step 4: From your browser, point to the URL your unzip.php is located at. And you are done, refresh your FTP client, and your should be able to see the decompressed files.
Similar Posts
Comments
3 Comments so far



































[...] bookmarks tagged development PHP - Unzip File from Browser saved by 17 others HokageIzlude bookmarked on 12/30/07 | [...]
hmmm, thanks i found this very useful, though i am going to use it in an image gallery application that i have developed.
:) JW
dint work for me