2016-01-27 17 views
11

Come titolo, mi crea il file zip dal mio server backend Django (ospitato su un Ubuntu 14.04.1 LTS) utilizzando il modulo python zipfile:Impossibile decomprimere un file di grandi dimensioni zip (3.3GB) in iOS9 utilizzando SSZipArchive

zipfile.ZipFile(dest_path, mode='w', compression=zipfile.ZIP_DEFLATED, 
       allowZip64=True) 

Sono riuscito ad aprirlo utilizzando il mio Mac in Finder, ma non ho avuto successo utilizzando la libreria SSZipArchive. Ho provato a utilizzare l'ultimo commit del ramo master e anche tag v1.0.1 e v0.4.0.

Utilizzando v0.4.0, ho ottenuto l'errore in linea 1506 di unzip.c:

if (unz64local_CheckCurrentFileCoherencyHeader(s, 
                &iSizeVar, 
                &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) 
     return UNZ_BADZIPFILE; 

e stucked a decomprimere sullo stesso file ogni volta con la stessa currentFileNumber.

Qualcuno ha qualche indizio?

P.S. Penso che SSZipArchive dovrebbe supportare il file di archivio Zip64 come ho chiesto un question sul loro repo github.

Aggiornamenti [20.160.129] ho eseguito un controllo ZipInfo sul file zip e hanno il seguente output:

... 
-rw-r--r-- 2.0 unx  1992 b- defN 26-Nov-15 14:59 <file_name> 
-rw-r--r-- 2.0 unx  925 b- defN 26-Nov-15 14:59 <file_name> 
-rw-r--r-- 2.0 unx  1194 b- defN 26-Nov-15 14:59 <file_name> 
-rw-r--r-- 2.0 unx  72 b- defN 26-Nov-15 14:52 <file_name> 
-rw-r--r-- 2.0 unx  289 b- defN 18-Jan-16 11:27 <file_name> 
-rw-r--r-- 2.0 unx  1541 b- defN 18-Jan-16 11:27 <file_name> 
-rw-r--r-- 2.0 unx  295 b- defN 18-Jan-16 11:27 <file_name> 
-rw-r--r-- 2.0 unx 449619181 b- defN 18-Jan-16 11:26 <file_name> 
-rw-r--r-- 4.5 unx 73128184 bx defN 18-Jan-16 11:26 <file_name> 
-rw-r--r-- 4.5 unx 69444488 bx defN 18-Jan-16 11:26 <file_name> 
-rw-r--r-- 4.5 unx 671440 bx defN 18-Jan-16 11:26 <file_name> 
-rw-r--r-- 4.5 unx 20189549 bx defN 18-Jan-16 11:27 <file_name> 
-rw-r--r-- 4.5 unx  197 bx defN 18-Jan-16 11:26 <file_name> 
-rw-r--r-- 4.5 unx 1379396 bx defN 18-Jan-16 11:26 <file_name> 
... 
+1

Sembra che la dimensione del file sia dichiarate erroneamente nelle intestazioni dell'archivio zip. Ci sono alcuni altri strumenti che si basano su minizip che hanno segnalato questo tipo di comportamento con i file JSON in particolare, anche se sembrano essere piuttosto vecchi problemi. Ti capita di conoscere il tipo di file che causa il problema e puoi rimuoverlo utilizzando un altro strumento zip per restringere il comportamento? –

+0

Trovo che il file che causa il problema sia un file video mp4 di grandi dimensioni. Ma non ho idea se questo grande video mp4 sia il colpevole. Vedete la linea 2.0 con la dimensione 449619181 sopra è il grande file mp4. –

+0

ti capita di avere un commento sul file mp4? http://stackoverflow.com/questions/20250022/why-minizip-doesnt-archive-large-file-larger-4-gb –

risposta

0

Dopo una decina di tentativi ed errori, l'ho trovato è un problema con la zip file generato dal pacchetto zipfile python. Se ho usato il comando zip fornito dal server Ubuntu della versione

Copyright (c) 1990-2008 Info-ZIP - Digitare "zip" -L "" per la licenza software.

Questo è Zip 3.0 (5 luglio 2008), da Info-ZIP.

per archiviare un grande dato di 4 GB, SSZipArchive può estrarre il pacchetto zip con successo.

Ho testato il file zip con ZipInfo e trovato:

... 
-rw-r--r-- 3.0 unx  2939 bx  2677 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx 15069 bx  3040 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  3265 bx  3003 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  3048 bx  2766 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  3453 bx  3168 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  1415 tx  534 defN 16-Jan-28 16:33 <file_name> 
drwxr-xr-x 3.0 unx  0 bx  0 stor 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  3302 tx  695 defN 16-Jan-28 16:33 <file_name> 
drwxr-xr-x 3.0 unx  0 bx  0 stor 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx 130678 bx 127322 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx 133540 bx 130045 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  136 tx  71 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  1416 tx  541 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  1417 tx  541 defN 16-Jan-28 16:33 <file_name> 
-rw-r--r-- 3.0 unx  2766 tx  652 defN 16-Jan-28 16:33 <file_name> 
5551 files, 3854751563 bytes uncompressed, 3793408959 bytes compressed: 1.6% 
Problemi correlati