Posts Tagged ‘unzip remotely’

Unzip Files on a Remote Server

January 9, 2011

A really handy timesaver is the the ability to upload a single zip file, rather than hundreds of tiny files, and then unzipping it remotely. This saves time on uploading and minimises the possibility of corruption or failed uploads for the odd file buried deep in an obscure directory.

  1. To achieve this, create a blank html file and save it as something like unzipfiles.php
  2. Between the <body></body> tags, paste the following: <?php system(‘unzip zipFileName.zip’); ?>
  3. Replace the zipFileName.zip with the name of your zip file and upload the new page and your zip file to the same directory
  4. Access unzipfiles.php through your browser and the decompression should take place, expanding the contents of your zip file into your remote directory

I tested this with a small zip file which worked fine. With a larger file however (the js directory of Magento), I got a “The operation couldn’t be completed’ message in the Activity window of the browser. When I checked the remote directory, it seemed to have unpacked itself anyway – but this only presented the structure of the directories without actuall unpacking the contents – so this didn’t work.

I suppose it ultimate depends on what host you are using. Small files good, big files bad.