php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41243 Ability to store uncompressed files
Submitted: 2007-04-30 16:05 UTC Modified: 2015-08-02 22:30 UTC
Votes:153
Avg. Score:4.6 ± 0.7
Reproduced:139 of 140 (99.3%)
Same Version:106 (76.3%)
Same OS:74 (53.2%)
From: joel dot alexandre at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: Zip Related
PHP Version: 7.0.0 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: joel dot alexandre at gmail dot com
New email:
PHP Version: OS:

 

 [2007-04-30 16:05 UTC] joel dot alexandre at gmail dot com
Description:
------------
How can the constant ZIPARCHIVE::CM_STORE be used to create a zip archive. That info is missing in the documentation.

This applies to all ZIPARCHIVE::FL_* and ZIPARCHIVE::CM_* flags.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-01 18:05 UTC] pajoye@php.net
"This applies to all ZIPARCHIVE::FL_* "

See:
http://www.php.net/manual/en/function.ziparchive-statname.php

That's where some of the flags can be used. Each function doc defines which flag or option can be used.

"and ZIPARCHIVE::CM_* flags."

The compression method (and mode) are read only for now. It is part of the entry info returned by the stat* functions.

Future versions will let you specify the compression mode and method.

Move to feature request and assign to me (it is in my todo but at least this bug may help other to figure it out or to provide patches :).
 [2009-05-26 11:31 UTC] andreidf at yahoo dot com
"Future versions will let you specify the compression mode and method."

When? :)
 [2009-12-13 16:49 UTC] made at up dot address
Please implement the ability to store files uncompressed in a zip archive.

Without this, it is not possible to create epub documents using php, as the standards require that a particular file is always added to the archive uncompressed.

http://www.idpf.org/2007/ops/OPS_2.0_final_spec.html
 [2010-03-16 04:53 UTC] jotunbane at gmail dot com
3 years and still no solution to this?

Dude you are holding back an entire industry here (exaggeration, I know).

Can somebody come up with a workaround for this??
 [2010-06-04 17:44 UTC] shockmaker at hotmail dot com
I'm looking to create a zip file with a compression level of 0 on some files.
So this feature is essential for me.
 [2010-07-02 14:20 UTC] php at atis dot id dot lv
This would be quite nice for me too. No compression could be useful for creating large archives of multiple files on the fly.
 [2011-02-21 21:04 UTC] jani@php.net
-Package: Feature/Change Request +Package: Zip Related
 [2012-01-23 10:57 UTC] mpeters at domblogger dot net
It is imperative that this bug be addressed and fixed.

The epub specification requires that the first file in the zip archive be named 
mimetype and be uncompressed.

Until this bug is fixed, it is thus impossible to create a valid epub file in 
pure php w/o executing system commands (forbidden in many environments).

*maybe* it could be worked around by having a skeleton zip archive with the 
mimetype file in it uncompressed, but really, we need to be able to create a 
fresh zip archive, add that file, with no compression.
 [2012-07-18 16:54 UTC] frozenfire@php.net
Any progress on this, pajoye? Given the number of votes on this bug, and its age, 
I think this needs to be addressed as soon as possible.

I encountered this bug today, and it's quite frustrating to not be able to set 
the compression level.
 [2012-10-17 12:01 UTC] spamme at filbilisim dot com
For back up features and performance issues uncompressed zipping is essential. Please provide this feature
 [2012-10-26 12:34 UTC] kalibrov1 at gmail dot com
Faced with the same problem, I can not create the correct ODS file!
 [2012-12-21 19:20 UTC] dac dot chartrand at gmail dot com
I need to create a zip file with a compression level of 0 on some files.

Specifically, the EPUB 2.0.1 specification *requires* a file called mimetype to  
uncompressed, unencrypted, and the first file in the ZIP archive.

Without this feature available in ZipArchive, it's useless for EPUB creation.

Thank you for your consideration.
 [2013-02-22 14:13 UTC] chaumond at gmail dot com
I need this capability as well. Can anyone help me fix the code and submit a Pull 
Request on Github?
 [2013-02-24 18:27 UTC] gilles dot bouthenot at univ-fcomte dot fr
Almost SIX years, and no sign that the php developper will improve ZipArchive. The lack of no-compression support is a show stopper, for me and others.
This should not be that hard to implement, do it ?
 [2014-06-02 09:17 UTC] whyarethingsnotgettingfixed at gmail dot com
Its the 7th year the bug is still open!

In 3 years time, we should organize a party!
 [2014-06-04 17:34 UTC] yvon at bayteksystems dot com
I feel like a necromancer. Raising the dead bug reports. Though this issue should really be looked into. 

Sort of makes the zip feature impotent and unable to function outside of a narrow scope. 

The least would be to have an ability to create zip archives with zero compression.
 [2014-06-30 13:12 UTC] netmaster4 dot datastore at web dot de
Can anyone fix this bug after a soooooo long periode ?

> ZIPARCHIVE::CM_STORE
 [2015-01-15 09:29 UTC] northkildonan at gmail dot com
still no solution to this bug?
are you serious?
 [2015-01-20 08:48 UTC] info at schroeffu dot ch
Wow! Since 2007 there is no solution for this bug?
why?
 [2015-04-08 23:54 UTC] wes dot hysell+developer at gmail dot com
Can we possibly re-assign this bug to an active developer? "pajoye" hasn't resolved any bug reports in a good while.
 [2015-08-02 21:27 UTC] cmb@php.net
This feature is available as of PHP 7.0.0, see
<https://github.com/php/php-src/commit/3a55ea02>.
 [2015-08-02 22:30 UTC] cmb@php.net
-Summary: How to use ZIPARCHIVE::CM_STORE +Summary: Ability to store uncompressed files -Status: Assigned +Status: Closed -Operating System: +Operating System: * -PHP Version: 5.x +PHP Version: 7.0.0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 06:01:29 2024 UTC