views:

204

answers:

4

Is there a way to create an uncompressed ZIP (level 0) from PHP? I can't find any info in the php documentation.

A: 

You can use exec() to run any command on the server, in which case it will depend on the environment (Linux, windows, etc.)

Shadow
A: 

If the zip tool is installed on your server, you can always use the shell_exec() function to execute an external command. That way you can most likely create an uncompressed zip file.

Nicolas
+1  A: 

According to php.net’s bugtracker (and bug #41243) this functionality is not available in the built-in zip utilities. For now you have to shell out.

Bombe
A: 

Thank you, guys!

I found a solution using pear's late Archive_Zip library. There's a bug in it causing corrupted files when using no_compression parameter. The solution found at http://pear.php.net/bugs/bug.php?id=7871 solved that problem!

Cambiata