PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

NotExists Validator

The NotExists validator checks for the existence of the provided files. It supports the following options:

  • *: Set any key or use a numeric array. Checks whether the 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 424. Using the NotExists Validator

<?php
$upload 
= new Zend_File_Transfer();

// Add the temp directory to check
$upload->addValidator('NotExists'false'\temp');

// Add two directories using the array notation
$upload->addValidator('NotExists'false,
                      array(
'\home\images',
                            
'\home\uploads')
                     );

Note

Note that this validator checks if the file does not exist in all of the provided directories. The validation will fail if the file does exist in any of the given directories.

Zend Framework