Answer the question
In order to leave comments, you need to log in
Modx api how to delete a file from a directory?
Hello.
The modx api has the ability to delete a resource, an object. I'm making a "change profile pictures" page. I'm trying to do the following - when the user has uploaded new photos and clicked the save button, then it would be necessary to delete the old photos from the folder in the root public_html/user_upload . I get links to old photos. What command can be used to delete files?
I tried it like this, but it didn't work.
$modx->remove($photo1);
Or modx api can't do it?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question