Your location:Tech News>News>Script>zip php in case of operation does not decompress compressed packet display of images

Latest News

zip php in case of operation does not decompress compressed packet display of images

Author:fsadmin

Views:

  $ Zip_path = ''12.zip ''; // compressed actual path

  $ Zip = zip_open ($ zip_path); // open compressed using the function zip_open

  while ($ re = zip_read ($ zip)) {// read sequentially read file in the package

  if (!zip_entry_filesize ($ re)) break; // If the file size is zero exit operation

  $ Entry_zp = zip_entry_open ($ zip, $ re, ''rb''); // read the package file

  $ Ext = pathinfo (zip_entry_name ($ re), PATHINFO_EXTENSION); // get the picture file extensions

  $ Buf = zip_entry_read ($ re, zip_entry_filesize ($ re)); // read the file binary data

  echo sprintf ( '''', $ ext, base64_encode ($ buf)); // use base64_encode function converts the read binary data input and output to the page, and

  zip_entry_close ($ re); // close open file compression package in

  }

  zip_close ($ zip); // close the archive file

Recommend article

Relate article