Ziparchive-php using Ziparchive class to compress file files?

Source: Internet
Author: User
Keywords Ziparchive compressed PHP
Tags ziparchive
Ziparchive compressed PHP

Header ("Content-type:text/html;charset=utf-8");
/**

  • Created by Phpstorm.
  • User:administrator
  • Date:2015/9/1
  • time:10:24*/

$zip = new Ziparchive (); First instantiate this class
if ($zip->open (' F:\test.zip ', ziparchive::overwrite=== TRUE)) {
$zip->addfile ("1439879545373869963.jpg");
Zip_close (); Shut down
echo ' OK ';
} else {
Echo ' failed ';
}

This is a very simple compression code, but this error will occur I use the Wamp integration package environment, PHP is 5.5 version, is not required to open PHP_ Zip.dll extension, again by the output can be output OK, that is, the Ziparchive class is successfully created, so should not be an extension of the problem, but Ziparchi is the method has been error, looking for a long time also do not know why, seek answers

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.