Cambiata
Cambiata

Reputation: 3845

Is there a way to create an uncompressed zip from PHP?

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

Upvotes: 1

Views: 972

Answers (4)

Cambiata
Cambiata

Reputation: 3845

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!

Upvotes: 0

Bombe
Bombe

Reputation: 83953

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.

Upvotes: 1

Nicolas
Nicolas

Reputation: 2186

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.

Upvotes: 1

Alex S
Alex S

Reputation: 26061

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

Upvotes: 0

Related Questions