This is a discussion on Test a zip file for validity within the PHP General forums, part of the PHP Programming Forums category; Hello all, How do I go about checking if a file is a zip file? Wrapping the zipinfo utility in ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
* Thus wrote Ivo Pletikosic (ivo@benetech.org):
> Hello all, > > How do I go about checking if a file is a zip file? > > Wrapping the zipinfo utility in php did not help since it does not return an > exit code whether it succeeded or not. I'm assuming the zipinfo your talking about is part of the unzip package. You should use unzip to test the files unzip -t file.zip will check the checksum for each file. 'man unzip' for further details. Curt -- "I used to think I was indecisive, but now I'm not so sure." |