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

Xamarin - unzip a file using the 32/64 bit unified approach

I have been using the ZipArchive component for Xamarin iOS development without any issues until the 'unified' code requirement has been enforced. There is not a unified version of ZipArchive available. I have tried ZipStorer, DotNetZip,…
3
votes
2 answers

Symfony ZipArchive PHP Extension Class Not Found

I tried this code var_dump(class_exists('ZipArchive')); $zip = new ZipArchive(); well, the output is like this. bool(true) Fatal error: Class 'MyProject\ProjectBundle\Controller\ZipArchive' not found in \path\to\my\Controller.php on line 83 Anyone…
Sherly Febrianti
  • 1,097
  • 15
  • 33
3
votes
1 answer

Retrieve directory structure of extracted zip file with PHP

I'm working on a bundling system for my applications where a user can upload a compressed zip file with the following structure: name_of_file.zip src/ file.jar thumbnail.png meta.json I would like to validate this structure after…
davidxd33
  • 1,186
  • 4
  • 22
  • 38
3
votes
2 answers

Error: Wrong export slider file format! This could be caused because the ZipArchive extension is not enabled

I'm getting this error while trying to import sliders in Revolution Slider Wordpress plugin: Error: Wrong export slider file format! This could be caused because the ZipArchive extension is not enabled. In my case the ZipArchive extension is…
Marco Marsala
  • 2,332
  • 5
  • 25
  • 39
3
votes
1 answer

Special characters issue while extracting zip folder using ZipArchive in php

My file name in the Zip folder is "Norge språk.pdf" and while extracting the zip folder, I'm getting the file name as "Norge spr†k.pdf". zip = new ZipArchive; if ($zip->open($path, ZIPARCHIVE::CREATE) === true) { …
Vini App
  • 7,339
  • 2
  • 26
  • 43
3
votes
1 answer

Extract zip into a specific directory with PHP ZipArchive

I have been unable to figure out if there is a way to extract a zip into a specific directory with php. When using code such as $zip->extractTo("files/"); it will extract the zip to the directory "files" and place all the files within a directory…
rcooper102
  • 209
  • 1
  • 11
3
votes
1 answer

Moving Firefox 13's startpage elements by editing omni.ja crashes FF, anyone know how to do this properly?

After removing the settings elements on Firefox 13's startpage, the google searchbox and logo are too low and I'd like to move them. I can edit the startpage by opening omni.ja with IZArc and going to…
3
votes
2 answers

Display Comic Book files on a webpage?

I'm thinking about creating a webpage and I'm trying to brainstorm some ways to display them in the page. If i wanted to get dirty and create everything myself, i think i could do it with html5, CSS3, and javascript/jquery. Just do some kind of…
Nick B.
  • 127
  • 3
  • 11
2
votes
1 answer

Skip "root" directory when extracting using ZipArchive class?

I am attempting to use the ZipArchive class to unzip the contents of a zip containing a GitHub repository. When you download a zip from GitHub, the zip contains a folder at the root of the zip named something like "project-2302392-20230"... Then…
TaylorOtwell
  • 7,177
  • 7
  • 32
  • 42
2
votes
1 answer

ziparchive password detection

Does anyone know a way to detect if a zip file has a pasword set when trying to unzip with the library ZipArchive? The code: [zip UnzipOpenFile:unzipFilename Password:zipPassword] will: unzip files with a password when zipPassword is set. unzip…
user7865437
  • 812
  • 14
  • 28
2
votes
1 answer

PHP: ZipArchive::extractTo() doesn't complete unzipping

I'm using ZipArchive to unzip files. It's working great, except for ONE file so far (it's 10.6MB, if that matters). The problem is, ZipArchive::extractTo() returns FALSE, and that's correct since if fails. BUT it doesn't completely fails: half of…
2
votes
1 answer

Terraform: using ${path.module} in a module does not point to module directory

I have a repo with my terraform module where i create a zip file using archive file which i then use as a filesource for a lambda data "archive_file" "example" { type = "zip" output_path = "./files/example.zip" source { content =…
2
votes
1 answer

ZipArchive::filename, how is it supposed to work?

I thought ZipArchive::filename would represent the path to the actual zip file, but for every zip file I open with ZipArchive::open(), ZipArchive::filename gives me an empty string. Example: $zip = new ZipArchive(); $zip->open(…
Decent Dabbler
  • 22,532
  • 8
  • 74
  • 106
2
votes
1 answer

golang archive/zip exclude subfolders?

func main() { // Open a zip archive for reading. r, err := zip.OpenReader("e:\\demo.zip") if err != nil { log.Fatal(err) } defer r.Close() for _, f := range r.File { if f.FileInfo().IsDir() { …
zeronofreya
  • 203
  • 2
  • 7
2
votes
1 answer

PHP: Unable to extact particular files from a ZIP archive

I am trying to extract files from a zip file, but its failing with following error Warning: copy(zip://upload/myzip-file.zip#myzip-file/file_001.csv): Failed to open stream: operation failed in {code line} My file myzip-file.zip is placed inside…
PHP Avenger
  • 1,744
  • 6
  • 37
  • 66