A Better Unzip

A while back I told you about a neat way to unzip files on the server.  Today I learned of a method that does the same thing, however this new method will overwrite files on the server.  This is great if you need to revert to an old version of WordPress, as I had to do this morning.

Just create a file called “unzip.php” and paste the following code into that file:

";
       system('unzip -o ' . $file);
       exit;
    }
    // create a handler to read the directory contents
    $handler = opendir(".");
    echo "Please choose a file to unzip: " . "
"; // A blank action field posts the form to itself echo '
'; $found = FALSE; // Used to see if there were any valid files // keep going until all files in directory have been read while ($file = readdir($handler)) { if (preg_match ("/.zip$/i", $file)) { echo ' ' . $file . '
'; $found = true; } } closedir($handler); if ($found == FALSE) echo "No files ending in .zip found
"; else echo '
Warning: Existing files will be overwritten.

'; echo "
"; ?>

Then upload unzip.php to the same directory as the file you want to unzip.

Then navigate to http://yourdomain.com/unzip.php and select the file you want to unzip.

Pretty neat, eh?

Many thanks to Learn CPP.

The Mighty Mo! Design Co.

RSS From Toby’s Blog

  • Where uncertainty exists, don’t order specific.
    4 Idiot Case Studies with 2 simple age-old business lessons. The post Where uncertainty exists, don’t order specific. appeared first on Toby Cryns, WordPress Trainer in Minneapolis, MN.
  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you. The post “Now THAT was a good meeting!” appeared first […]
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]

More posts from themightymo.com

WordPress 2.8 Released!!!

By | June 11, 2009

I have been anxiously awaiting the release of WordPress 2.8, and finally the wait is over! The most interesting new feature to me is the new Widgets API, which will allow plugin developers like me to more easily do our thing! Check out other new features in this video:

New WhereAmIWearing.com, WordPress Site, is Rolling!

By | June 10, 2009

I am excited and proud to have contributed my WordPress skillz to the legendary Rule29 web shop with the new Where Am I Wearing? website!  The site is built on the WordPress framework and features just about every cool widget that you can imagine.  I was responsible for translating the design into code and had…

Notes from “Getting the Pretty Stuff In” Presentation at Flashbelt with Paul Burnett

By | June 8, 2009

Photoshop Take a bunch of photos of the exterior of a building 1) Select all the photos 2) Tools –> Open into Layers 3) “Auto-align” the layers 4) (with all of the layers selected) Layer –> Smart Objects –> Convert to smart object 5) Layer –> Smart objects –> Stack mode –> Median To stitch…

RSS From Toby’s Blog

  • Where uncertainty exists, don’t order specific.
    4 Idiot Case Studies with 2 simple age-old business lessons. The post Where uncertainty exists, don’t order specific. appeared first on Toby Cryns, WordPress Trainer in Minneapolis, MN.
  • “Now THAT was a good meeting!”
    A single effective meeting can change the course of history for a company. Imagine if you could lead effective meetings EVERY DAY! You can, but it takes curiosity & practice. This article is a good place to start your journey to a more effective you. The post “Now THAT was a good meeting!” appeared first […]
  • Never Respond to RFPs & Custom Proposal Requests
    Y'all who work at normal 9-5 jobs don't need to deal with the B.S. that is an RFP process (or rather you get paid to deal with it). But us freelancers gotta deal with a whole big bag of schtuff when it comes to custom proposals. Here's my quick-and-dirty RFP filtering process that I use […]