There was an error unpacking your file. Perhaps you have not uploaded a valid zip file, or you do not have zip installed

Permalink 1 user found helpful
Hey,

I am new to Concrete 5 and loving it, just bought my first add in and when I try to instal it I get this message. I have searched all over but dont seem to be able to resolve it.

Error: The following errors occurred when attempting to process your request:

* There was an error unpacking your file. Perhaps you have not uploaded a valid zip file, or you do not have zip installed.

I am running concrete on Windows 2003, with IIS 6 and MySQL.

Any help would be kindly appreciated,
Guy

 
jordanlev replied on at Permalink Reply
jordanlev
I get this error on my server (which is Ubuntu, so this isn't specific to Windows). Despite being a very experience programmer, I could never figure this issue out. I never had the problem on any other servers (and never on my clients' servers, thankfully). I eventually gave up trying and just had to upload addons and system upgrades manually via FTP.

To do this, you just drop packages into your site's /packages/ directory (after unzipping them yourself of course) and then you can install them like normal from the Dashboard's "Add Functionality" page. For system updates, you can just overwrite the entire /concrete/ directory with the /concrete/ directory from the latest update.

-Jordan
vicente replied on at Permalink Reply
vicente
I've tried all options here (below) and none work, how can U download via FTP? In my case all seems to be locked up via the marketplace so I can't use any of the addons on my local server due to this same error.
Biscuit replied on at Permalink Reply
If you release them from the project you'll be able to download them (to your local computer, then upload via FTP).
TheRealSean replied on at Permalink Reply
TheRealSean
Try this fix, it would appear to be a problem with a bug in php

see here for a potential fix
http://www.concrete5.org/index.php?cID=104023...
jordanlev replied on at Permalink Reply
jordanlev
Wow, this is great that someone found out what the problem is -- thanks for posting that!

However, I am unable to actually see a fix -- I only see a link to an explanation of the problem, and some code that bypasses the unzipping (so you won't get an error but you won't get your files unzipped either)... unless I'm missing something?

Thanks again.

-Jordan
TheRealSean replied on at Permalink Best Answer Reply
TheRealSean
Perhaps fix is the wrong word, but the work around or what ever we are calling it has got the updates to for me.

From my understanding its the $zip->open that causes problems thus using a version 5.2.x in my case seems to download the file but does is then unable to open the zip file, the php error being something to do with the file size, thus the Exception being thrown the addition of "version_compare(phpversion(), '5.3.0', '>=')" seems to get the server to use shell_exec() instead of the $zip->open().


The relevant code appears to be the following (line 59 conrete/libraries/archive.php)

protected function unzip($directory) {
      $file = $directory . '.zip';
      $fh = Loader::helper('file');
      if (version_compare(phpversion(), '5.3.0', '>=') && function_exists('zip_open')) {
         $zip = new ZipArchive;
         if ($zip->open($fh->getTemporaryDirectory() . '/' . $file) === TRUE) {
            $zip->extractTo($fh->getTemporaryDirectory() . '/' . $directory . '/');
            $zip->close();   
            return $fh->getTemporaryDirectory() . '/' . $directory;
         }         
         throw new Exception(t('There was an error unpacking the file. Perhaps you have not uploaded a valid zip file, or you do not have zip installed.'));         
       } else {
         $ret = @shell_exec(DIR_FILES_BIN_UNZIP . ' ' . $fh->getTemporaryDirectory() . '/' . $file . ' -d ' . $fh->getTemporaryDirectory() . '/' . $directory . '/');
         $files = $this->f->getDirectoryContents($fh->getTemporaryDirectory() . '/' . $directory);
         if (count($files) == 0) {