adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

one question zip files with 0 bytes

Open emazzu opened this issue 8 years ago • 7 comments

Hi, how are you ?

I want to zip those files, It do the compress, but when I want to open the zip file, this has 0 bytes !!!

var zip = new admZip();

zip.addLocalFile("/home/xmazzuce/Downloads/004534111.PDF"); zip.addLocalFile("/home/xmazzuce/Downloads/004534107.PDF"); zip.addLocalFile("/home/xmazzuce/Downloads/004534117.PDF"); zip.addLocalFile("/home/xmazzuce/Downloads/004209531.PDF");

zip.writeZip(/target file name/"/home/xmazzuce/apps/wells/files.zip");

I'm doing something wrong ???

2017-02-13_11h02_32

emazzu avatar Feb 13 '17 14:02 emazzu

This is the permission issue in Linux Distros. Run the same code in Windows and try. If you see those files in windows please let me know.

suchendra avatar Feb 21 '17 10:02 suchendra

I have the same symptoms in my code. On redhat, zip file shows the files there with size of 0 bytes. I am able to extract and view them correctly. If i copy the zip to a Windows platform, it shows as empty. If I try to "extract all" it shows that it is trying to extract the files, but then complains that the files (which are about 1K) are too big for the filesystem.

dwightdegroff avatar Feb 21 '17 17:02 dwightdegroff

if (!attr) {
		if (entry.isDirectory)  {
			attr = (040755 << 16) | 0x10;
		}
               else {
		         attr = 0644 << 16;
		}
     }	

There is a permission issue. Please use this code in adm-zip.js (in the adm-zip module). Let me know the result

suchendra avatar Feb 24 '17 05:02 suchendra

I am having the same issue... The zip will extract proper files on OSX but not on Windows or *Nix.

niczak avatar Mar 28 '17 20:03 niczak

I have commented above, please the refer that comment. That is a standard solution. Thanks

suchendra avatar Mar 31 '17 02:03 suchendra

I have commented above, please the refer that comment. That is a standard solution. Thanks

Where am I supposed to add that code in adm.js file? What line number?

prashilthegreat avatar Nov 02 '21 10:11 prashilthegreat

Yes someone please mention where to add the code

sudip-modi avatar Sep 15 '22 22:09 sudip-modi