The Exists validator checks for the existence of specified
files. It supports the following options:
*: Sets any key or use a numeric array to check if the specific file exists in the given directory.
This validator accepts multiple directories, either as a comma-delimited string, or as
an array. You may also use the methods setDirectory(),
addDirectory(), and getDirectory()
to set and retrieve directories.
Example 402. Using the Exists Validator
<?php
$upload = new Zend_File_Transfer();
// Add the temp directory to check for
$upload->addValidator('Exists', false, '\temp');
// Add two directories using the array notation
$upload->addValidator('Exists',
false,
array('\home\images', '\home\uploads'));
Note
Note that this validator checks whether the specified file exists in all of the given directories. The validation will fail if the file does not exist in any of the given directories.




