Questions tagged [ziparchive]

ZipArchive is a PHP extension for manipulating zip compressed archives.

ZipArchive provides procedural and object oriented approaches for creating, extracting and editing zip archives. The php manual provides a full documentation for both approaches, while on wikipedia history and technique of zip compression is covered.

818 questions
6
votes
3 answers

how to zip folder in laravel 5?

need some help for laravel zip file. i have a folder in the public folder and i would like to create a zip of that folder (temp_file folder) whenever the user clicks the button. public function testing() { $public_dir =…
needhelp
  • 107
  • 1
  • 2
  • 5
6
votes
1 answer

Save ZipArchive to file

In my application I have a class manipulating with zip archive using System.IO.Compression.ZipArchive. Now I want to save the entries of the archive to file. How can I do that? I know I can associate a Stream with archive but in my case the archive…
folibis
  • 12,048
  • 6
  • 54
  • 97
6
votes
4 answers

Extract specific files in zip (include sub directories)

I want to extract only images from a zip file but i also want it to extract images that are found in subfolders as well.How can i achieve this based on my code below.Note: i am not trying to preserve directory structure here , just want to extract…
user2650277
  • 6,289
  • 17
  • 63
  • 132
5
votes
3 answers

Extract folder content using ZipArchive

I have compressed_file.zip on a site with this structure: I want to extract all content from version_1.x folder to my root folder: How can I do that? is possible without recursion?
quantme
  • 3,609
  • 4
  • 34
  • 49
5
votes
1 answer

Upload zip archive files to S3 with node

I download a ziparchive from an api, which contains gzipped files, and i need to take the gz files and save to s3. Don't want to uncompress or anything. Just move to S3. When i open the archive, it has a folder w/ random numbers, /12345/file1.gz,…
Ron
  • 195
  • 1
  • 2
  • 10
5
votes
2 answers

ZipArchive::close(): Renaming temporary file failed: Permission denied

I have this strange error, when I try to delete a file inside a compressed directory : ZipArchive::close(): Renaming temporary file failed: Permission denied in /MyDirectory/myphpscript.php Here is my code :
Nika Kurdadze
  • 2,502
  • 4
  • 18
  • 28
5
votes
1 answer

Edit ZipArchive in memory .NET

I'm trying to edit a XmlDocument file contained in a Zip file: var zip = new ZipArchive(myZipFileInMemoryStream, ZipArchiveMode.Update); var entry = zip.GetEntry("filenameToEdit"); using (var st = entry.Open()) { var xml = new XmlDocument(); …
Emaborsa
  • 2,360
  • 4
  • 28
  • 50
5
votes
1 answer

Encryption/Decryption using ZipArchive class

I did some investigation and cannot see native way to implement encryption/decryption using ZipArchive class. https://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive(v=vs.110).aspx It seems like MSDN does not provide this…
NoWar
  • 36,338
  • 80
  • 323
  • 498
5
votes
1 answer

PHP: Error (500) when creating a zip file with ZipArchive

I'm using phps ZipArchive class to create a zip file of a directory. The code works fine for almost all directories except two, which happen to be the largest ones (the largest directory currently contains 51 files with a total of 175MB). When I'm…
MatthewS
  • 51
  • 1
  • 3
5
votes
3 answers

ZipArchive PHP: Close() returns false with no error message

I'm trying to create a zip file with directory tree based on array strutucture. I already use this answer when I need to create a zip file from a directory tree, but in this case all the files are in the same directory and the directory tree is…
Ricardo Gonçalves
  • 4,344
  • 2
  • 20
  • 30
5
votes
1 answer

Unzip Files in iOS

I have a .zip folder which contains some images. I want it to unzip into Documents directory in iOS device. I tried with the following link, download and unzip file in iOS-Stack Overflow Here is the code that I tried in my app, NSArray *paths =…
codebot
  • 2,540
  • 3
  • 38
  • 89
5
votes
3 answers

Why won't PHP create this zip file (permissions issue)

I am on windows I am using PHING to zip up some files I have lots of things being zipped Zipping works, except for ones that include a particular phing fileset in the files being zipped When I debug, I can see in phing's ZIP Task that…
Josh Ribakoff
  • 2,948
  • 3
  • 27
  • 26
5
votes
4 answers

ZipArchive Library Is Not Enabled When Using PHPExcel

I am using CodeIgniter and PHPExcel to read and write to excel files. Everything worked fine in localhost, but when I uploaded my PHP CodeIgniter application to the server in pagodabox I got the below message when I tried to read data from excel…
adib.mosharrof
  • 1,624
  • 1
  • 12
  • 16
5
votes
3 answers

ZipArchives stores absolute paths

Can I zip files using relative paths? For example: $zip->addFile('c:/wamp/www/foo/file.txt'); the ZIP should have a directory structure like: foo -> file.txt and not: wamp -> www -> foo -> file.txt like it is by default... ps: my…
Alex
  • 66,732
  • 177
  • 439
  • 641
5
votes
2 answers

"Undefined symbols for architecture i386" on unit tests

I'm getting the following error only when I try to build the unit tests of an iPhone static library: Undefined symbols for architecture i386: "std::terminate()", referenced from: -[ZipArchive dealloc] in libMyProject.a(ZipArchive.o) …
hpique
  • 119,096
  • 131
  • 338
  • 476