How to attach and download files
How to attach and download files
jyd0228
Posts: 30Questions: 11Answers: 0
Hello,
I want to implement a function to attach and download files.
https://editor.datatables.net/examples/advanced/upload-many.html <- I found a way to attach multiple files from that link.(There is more than one file to be attached.)
I want to know how to download the attached file by clicking Download in the table.
Could you please let me know if there is a sample to download the attached files?
This discussion has been closed.
Answers
This thread should help, it's asking the same thing.
Cheers,
Colin
'dbClean' function does not work when 'upload-many' is used.
When I deleted uploaded file, it is deleted from the 'USERS_FILES' table,
but not from the 'FILES' table.
Can't I use 'dbClean' function in 'upload-many'?
It should do, can you give me a link to a page showing the issue and also the PHP code you are using please?
Thanks,
Allan
https://editor.datatables.net/examples/advanced/upload-many
Add 'dbClean' here.
.dbClean(async function(data) {
for (let i = 0, ien = data.length; i < ien; i++) {
await unlink(data[i].system_path);
}
return true;
})
If you delete the file after adding 'dbClean' and executing it, the file is deleted from the 'users_files' table, but not from the 'files' table.