T
T
Tarasovych2017-04-18 23:59:21
PHP
Tarasovych, 2017-04-18 23:59:21

How to implement deleting a file uploaded via CKEditor?

Example: I created an article, in the "body" of which there is text, images.
When deleting an article, the entry from the database (i.e., the text) will be deleted, but the image itself, uploaded to the server via CKEditor, will remain.
How can I delete all the files that were uploaded when deleting an article (so as not to clog the server)?
Parse by filename (generated by CKEditor) and delete?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
4
4iloveg, 2017-04-19
@4iloveg

You can add to a specific folder and, when deleting, delete it with all its contents.
Those. folder name based on the id of the future article, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question