I want to delete file. I know relative path from public directory.
Is any zend-way methods to delete file?
I think define BASE_DIR in index.php is not right way.
I want to delete file. I know relative path from public directory. Is any
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming directory structure like this:
path to
file1isthen you may perform any string operations on this path
(e.g. check the length of your relative path and substract it from the ending of
$path)APPLICATION_PATHis already defined inindex.phpbyZend_Application.Then you may delete the file using
unlink.It’s just a guess. You didn’t write how the file is stored.