delete uploaded files
delete uploaded files
further to a previous question in this thread https://datatables.net/forums/discussion/27034/
i have my file upload working successfully, but want to ability to delete the file on deletion of the row in the database
on my ajax page, i am checking for post of delete as follows...
if ( isset($_POST['action']) && $_POST['action'] === 'remove' ) {
...
}
but cant work out how to retrieve the name of the document, as the data object is not sent on remove http://editor.datatables.net/manual/server
(on edit, I would use something like $_POST['data']['tablename']['fieldname'])
This question has an accepted answers - jump to answer
Answers
You would need to query the database for each row that is being deleted to get the field name and then
unlink()
it.Editor doesn't send the row data on delete as it isn't normally needed. However, that is likely to change in 1.5 where I will have it send the data for the rows to be deleted for exactly this for of reason.
Allan
of course!!
I will just use the id returned to query my table.
Thanks again