What's wrong w this code: file_get_contents from remote zipped file and extract to local directory
<p>The purpose of this code is to pull upgrade.zip from a central server, extract it and place it in a folder on the resident server. I get no errors, it just results in the          die("!There was a problem. Please try again!");  </p>

<pre><code>require('../../../wp-blog-header.php');

function openZip($file_to_open) { 
    global $target;  
    $zip = new ZipArchive();  
    $x = $zip-&gt;open($file_to_open);  
    if($x === true) {  
        $zip-&gt;extractTo($target);  
        $zip-&gt;close();  
        unlink($file_to_open);  
    } else {  
        die("!There was a problem. Please try again!");  
    }  
} 

$payload = file_get_contents('http://myserver.com/upgrade.zip');
if(isset($payload)) 
    {
    $filename = 'upgrade.zip';
    $source = file_get_contents('http://myserver.com/upgrade.zip');
    $target = ABSPATH.'wp-content/themes/mytheme/';

    // permission settings for newly created folders
    $chmod = 0755;  

    $saved_file_location = $target . $filename;

openZip($saved_file_location);

}
</code></pre>
