Hi, I Question a Problems (Download selected file on DataTables)
Hi, I Question a Problems (Download selected file on DataTables)
cumhur
Posts: 4Questions: 2Answers: 0
I have added a datatables script on the website. I listed the files added in a folder in the DataTables context. I want to download the files in the list, but I could not place the script somewhere
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I'm not sure what you mean by "could not place the script" - could you clarify that? Do you mean you don't know how to make the button do the download? I would either use
columns.render
to display the button with the correct HTML needed for it, or use a jQueryclick
event listener on the button.Allan
Allan,thank you so much.
My problem is (scenario),
1. users will upload files through the web site.(
I did it.)
2. the files loaded in a folder will be listed.(
I did it.)
3. I want to download the files listed on my own computer.
4.
I want to do this through datatables, how do I do it
5.
When the button on the image is clicked, the user will be asked to download the file with the file specified on the left side. but I did not do it
I would suggest using the
columns.render
option to link to the files. If you have uploaded them to the server, presumably you have information about where they are stored on the server (perhaps in the database?) and you can use that to generate the url for the download link.Allan