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
4
votes
1 answer

Edit file without unzipping archive

How do i edit file without unzipping archive, reason is i am writing automation task, I can do unzip, edit file and zip it, But it would be good if i can do it in runtime so it will save time to unzip/zip.
Satish
  • 16,544
  • 29
  • 93
  • 149
4
votes
1 answer

Create zip archive and stream it to ftp server

I am trying to create a zip file from local files and stream it directly to an ftp (without writing the zip to disk first). I have no problems with zipping itself but it seems like the ZipArchive class doesn't recognize the ftp stream wrapper. The…
stormbreaker
  • 848
  • 13
  • 22
4
votes
4 answers

How to check if a zip file is password protected in IOS?

I am using ZipArchive to extract zip files in an iOS application, but I want to know before openning the file if it's password protected or not so that I can pass the password to the UnZipOpenFile function.
Eman.H
  • 97
  • 1
  • 7
4
votes
1 answer

ZipArchive file is invalid

I need a simple function that writes an array of files to one zip file. I found some code from an online tutorial and modified it slightly, but I can't seem to get it to work. It creates the zip file, but when I try and extract it I get an…
liz
  • 830
  • 14
  • 32
3
votes
2 answers

How to handle huge file in dotnet core?

in the last months I've been working on an exportation project, basically the application needs to get files from blob storage, unify the files in a single file, compress into a zip and upload it in blob storage. I fragmentated the process in steps.…
3
votes
1 answer

How to send an Encrypted Zip Archive as Mail Attachment in PHP?

I found answers on encrypting zip files and also on how to send files in mail attachments. Both in separate questions. So I combined the both to make it easier for others. This is a self answered question. You will be able to generate a random…
Ebenezer Isaac
  • 772
  • 1
  • 8
  • 31
3
votes
0 answers

ZipArchive::close(): Failure to create temporary file: No error

I'm using Yii2 - phpExcel to export data. But only in my localhost (Windows - XAMPP - PHP7), there is an error: ** ZipArchive::close(): Failure to create temporary file: No error ** This screenshoot is my test code and it returned the same error.…
3
votes
2 answers

Nodejs and update file inside zip archive

I want update file in zip arhive with nodejs. For example i have zip file with two files: a.zip |-a.txt |-b.txt I use archiver: var archiver = require('archiver'); var archive = archiver('zip',…
alex10
  • 2,726
  • 3
  • 22
  • 35
3
votes
1 answer

Update a file in a ZipArchive

I have a ZipArchive object which contains an XML file that I am modifying. I then want to return the modified ZipArchive. Here's the code I have: var package = File.ReadAllBytes(/* location of existing .zip */); using (var packageStream = new…
awj
  • 7,482
  • 10
  • 66
  • 120
3
votes
0 answers

System.MissingMethodException when trying to extract ZipFile from ZipArchive

I have a C# .NET (v4.6.2) WinForms app where I'm accessing a file that may/may not be a .zip archive that was created using System.IO.Compression. I have both System.IO.Compression and System.IO.Compress.FileSystem references in the project and…
Jeff S.
  • 33
  • 7
3
votes
0 answers

wordpress, Zip and download works in one folder and not works in other

I am trying to zip and download files (pdf) in wordpress. It works fine in the root directory. But not working inside wp-content>themes>functions.php. It gets downloaded and on opening, it shows **archive is either unknown format or damaged**.…
3
votes
0 answers

php codeigniter zip file crash

i have multiple image and packed to zip file to download the image. When i click download, the zip file size is 404 byte and the zip file crash. What problem make my zip file crashed file download zip file public function…
3
votes
1 answer

Self extracting archive (EXE) for Windows

I'm looking for an easy way to create a self extracting archive (EXE) on Microsoft Windows platforms. I know that there is a built-in tool IExpress.exe, but that has a wizard style UI and I need a "silent" tool, which can be called by scripts. It…
Michael
  • 532
  • 1
  • 6
  • 15
3
votes
1 answer

Ziparchive: How to close the created entry from ziparchive

I have written a method as below to bind multiple Memorystream to ziparchive. The code is working for one stream, but if I add a multiple stream by iterating, then it shows following error in 2nd line from for loop. System.IO.IOException: 'Entries…
Md Aslam
  • 1,228
  • 8
  • 27
  • 61
3
votes
1 answer

Using ZipArchive with ASP.NET Core Web Api

The question is how can I create a zipped (compressed) folder on the fly using ASP.NET Core 2 (currently) Web API? I am using System.IO.Compression.ZipArchive I have been several blog posts where this is done using streams or byte arrays, all give…
shammelburg
  • 6,974
  • 7
  • 26
  • 34