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.
  • “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.
  • 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

Make WordPress Work for You: How to turn your self-hosted WordPress blog into a totally rocking Content Management System (CMS)

By | March 7, 2009

WordPress Presentation What we might cover How many people have a website or blog? Brainstorm ideas for websites.  What do you want your website to do? WordPress as a CMS Examples: GBSSA.org, TeamUpMn.org, Letronica.com (http://www.letronica.com/content/), cryns.com Switching WordPress from a Blog to a CMS Photo Gallery: http://www.cryns.com/category/photos/ Post by email iPhone Application Cool Plugins: Podpress…

Unsummit Minneapolis

By | March 7, 2009

Today I will be liveblogging from the Unsummit (un)conference in Minneapolis. So far, I have bumped into all sorts of superstars from the local blogging and online social media scene, which is always fun.  I am looking forward to attending: “Launching a Startup in Your Spare Time” “Getting Good Ideas When Ideas are Tough” UnPanel…

Mark Gason Papervision 3D Presentation at FlashMN

By | February 18, 2009

I am liveblogging from Mark Gason’s presentation at FlashMN. These are my notes. Check out Mark’s page of resources.  It contains links to tutorials as well as all sorts of other Papervision 3D-related stuff.  http://gasolicious.com/flashstuff/PV3D_presentation.html Swift 3D is better than Papervision 3D in some ways: – You can model in Swift 3D, but AutoCAD also…

RSS From Toby’s Blog

  • Where uncertainty exists, don’t order specific.
    4 Idiot Case Studies with 2 simple age-old business lessons.
  • “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.
  • 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 […]