Skip to content
Advertisement

Tag: zip

Invalid or unitialized Zip object

I am getting Warning: ZipArchive::addFile() [function.ZipArchive-addFile]: Invalid or unitialized Zip object. what could be problem? I tried many methods but in vain. I am able to create and initiate download when I select one file. However, I get above error when I select more than one file. Answer The power of indenting correctly! You are closing your zip file inside

Create a zip file and download it

I am trying to download a 2 files by creating the zip file on local-server.the file is downloaded in zip format but when i try to extract it.it gives error: End-of-central-directory signature not found. Either this file is not a zip file, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zip

Zip files contain same files but have different hashes?

I have created hundreds of folders and text files using php, I then add them to a zip archive. This all works fine but if I create another zip archive using the same folders and files, the new archive will have a different hash to the first one. This is the same if I use winrar instead of php to

Delete a folder inside zip in php

I’ve a ZIP file (skins.zip) having the following structure: I need to delete folder called theme/ inside the skins.zip. I’ve tried the following code but didn’t worked. Can anyone help me, please? Answer I’ve just the following code and left the print_r output for you to understand what’s going on: It outputs something like this:

How to zip a whole folder using PHP

I have found here at stackoveflow some codes on how to ZIP a specific file, but how about a specific folder? inside in My Folder, there are files. after zipping the My Folder, i also want to delete the whole content of the folder except important.txt. Found this here at stack I need your help. thanks. Answer Code updated 2015/04/22.

Download of .zip file runs a corrupted file php

I’m trying to force a download of a protected zip file (I don’t want people to access it without logging in first. I have the function created for the login and such , but I’m running into a problem where the downloaded file is corrupting. Here’s the code I have: Here’s the error: Cannot open file: It does not appear

Advertisement