Zend_File_Transfer has several methods that check for various
states of the specified file. These are useful if you must process files after they have
been uploaded. These methods include:
isValid($files = null): This method will check if the given files are valid, based on the validators that are attached to the files. If no files are specified, all files will be checked. You can call
isValid()before callingreceive(); in this case,receive()will not callisValid()internally again when receiving the file.isUploaded($files = null): This method will check if the specified files have been uploaded by the user. This is useful when you have defined one or more optional files. When no files are specified, all files will be checked.
isReceived($files = null): This method will check if the given files have already been received. When no files are specified, all files will be checked.
Example 387. Checking Files
<?php
$upload = new Zend_File_Transfer();
// Returns all known internal file information
$files = $upload->getFileInfo();
foreach ($files as $file => $info) {
// file uploaded ?
if (!$upload->isUploaded($file)) {
print "Why havn't you uploaded the file ?";
continue;
}
// validators are ok ?
if (!$upload->isValid($file)) {
print "Sorry but $file is not what we wanted";
continue;
}
}
$upload->receive();




