Jump to content

Search the Community

Showing results for tags 'ziparchive'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (Dreamweaver, Zend, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 2 results

  1. Hello, I am creating zip file of multiple files using PHP and downloading it. Problem is that: zip file is getting extracted by only WinRAR, its not getti ng extracted by default windows extracter or other software. Here is code which I have written - $file_folder = 'referral-resume/'; if(extension_loaded('zip')) { if(isset($_POST['files']) and count($_POST['files']) > 0) { $zip = new ZipArchive(); $zip_name = "referralresumes".time().".zip"; if($zip->open($zip_name, ZIPARCHIVE::CREATE)!==TRUE) { $error .= "* Sorry ZIP creation failed at this time"; } foreach($_POST['files'] as $file){ $zip->addFromString(basename($file_folder.$file), file_get_contents($file_folder.$file)); } $zip->close(); if(file_exists($zip_name)){ header('Content-type: application/zip'); header('Content-Disposition: attachment; filename="'.$zip_name.'"'); readfile($zip_name); unlink($zip_name); } } else{ $error .= "* Please select file to zip "; } } else{ $error .= "* You dont have ZIP extension"; }
  2. Does anybody know why this code is adding itself (i.e. an empty zip file of same name, full path) to the zip file? $fn="data/test_01.zip"; $zip = new ZipArchive(); if($zip->open($fn,ZipArchive::OVERWRITE)!==TRUE){ echo "cannot open ".$fn; } $zip->addFromString("myfile.txt","Some content"); $zip->addEmptyDir("testdir"); $zip->close(); I've fully updated my system and restarted services
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.