The IsCompressed validator checks if a transferred file is a
compressed archive, such as zip or arc. This validator is based on the
MimeType validator and supports the same methods and options.
You may also limit this validator to particular compression types with the methods
described there.
Example 406. Using the IsCompressed Validator
<?php
$upload = new Zend_File_Transfer();
// Checks is the uploaded file is a compressed archive
$upload->addValidator('IsCompressed', false);
// Limits this validator to zip files only
$upload->addValidator('IsCompressed', false, array('application/zip'));
// Limits this validator to zip files only using simpler notation
$upload->addValidator('IsCompressed', false, 'zip');
Note
Note that there is no check if you set a MIME type that is not a archive. For example, it would be possible to define gif files to be accepted by this validator. Using the 'MimeType' validator for files which are not archived will result in more readable code.




