Page 1 of 1

php zip and download online image

Posted: Thu Mar 31, 2016 2:05 am
by howardhee
Below is my question, how to I solve it?
http://stackoverflow.com/questions/3619 ... 0_36195826

Please help. Thanks

Re: php zip and download online image

Posted: Thu Mar 31, 2016 10:28 am
by Christopher
You are not created a ZIP file. The code should be:

Code: Select all

        $zip_name = "zipfile.zip";
        $zip = new ZipArchive($zip_name);
Even then, it is not clear where the file will be created. You need to give it a full path like "/tmp/zipfile.zip". Also, you should give the file an unique name so multiple requests do not create the same file at the same time. And delete the file when you are done.