Compressing file to Zip file using PHP on Google App Engine

784 views
Skip to first unread message

Jay Shah

unread,
Jun 25, 2014, 12:36:17 PM6/25/14
to google-a...@googlegroups.com

Hi guys

I'm trying to compress txt file to a zip file stored on a google cloud storage bucket.

I've written a function below which works on local files but not on files stored on the cloud bucket.

I suspect the problem is the ZipArchive class, however, the 1.8.9 App Engine release notes indicate that the zip extension is now supported.

   

   
  function CompressFile($inputFilePath, $ZipArchivePath, $fileNameinArchive)
   
{
    $zip
= new ZipArchive();
    $zip
->open($ZipArchivePath,  ZipArchive::CREATE);
    $zip
->addFile($inputFilePath, $fileNameinArchive);    
    $zip
->close();
   
   
}




Any suggestions?

Cheers

Vinny P

unread,
Jul 9, 2014, 1:27:18 AM7/9/14
to google-a...@googlegroups.com
On Wed, Jun 25, 2014 at 11:36 AM, Jay Shah <j...@brainlabsdigital.com> wrote:
I suspect the problem is the ZipArchive class, however, the 1.8.9 App Engine release notes indicate that the zip extension is now supported.
   
  function CompressFile($inputFilePath, $ZipArchivePath, $fileNameinArchive)
    
 $zip = new ZipArchive();$zip->open($ZipArchivePath,  ZipArchive::CREATE);
    $zip
->addFile($inputFilePath, $fileNameinArchive);$zip->close();  }
Any suggestions?



Can you call error_get_last and see what the last recorded error is?
 
 
-----------------
-Vinny P
Technology & Media Consultant
Chicago, IL

App Engine Code Samples: http://www.learntogoogleit.com

Mars Lan

unread,
Jul 9, 2014, 3:55:10 PM7/9/14
to google-a...@googlegroups.com
Thanks for reporting. This is a known issue: https://code.google.com/p/googleappengine/issues/detail?id=11010
Reply all
Reply to author
Forward
0 new messages