Assuming a directory structure as follows:
/application/
/public/
/files
file1
path to file1equal
$path = realpath(APPLICATION_PATH . '/../public/files/file1')
then you can perform any string operations on this path (for example, check the length of your relative path and subtract it from the end $path)
APPLICATION_PATHalready defined in index.phpon Zend_Application.
Then you can delete the file with unlink.
This is just a hunch. You did not write how the file is stored.
source
share