How to display the DOC/PPT file in a directory on the server to the html page for download?

in the development of a website that provides downloading of learning materials, I have put the materials on the server. Now I am very confused and do not know how to display them on the html page. At first, I wrote a tag one by one, but I feel unrealistic. I always feel that I should be associated with the database. I am very confused. I hope all of you will not begrudge your advice.


whether you need a database for this requirement depends on what additional functions you want to provide on the basis of downloads, if you want to provide like, download statistics, comments and similar functions, then you should record all the documents in the database, so that you can design fields on the database to support the functions you want to achieve.

if it is a pure download, without other functions, you can also use a to list downloadable files directly on the page without using the database. Of course, you should not write a by hand, which is not only tedious, but also error-prone. A better way is to automatically generate links for download by enumerating a directory. The specific implementation is related to the technical framework you use, but whether it's php, java, or other platforms, this is relatively easy.


Thank you! Yes, I just provide a download link. What is the general way to enumerate this directory? Do you use JAVA backstage?

Menu