How can show documents for downloading in detailed view?

richardm

New member
Hellow,

I have a field in my DB for uploading files. Some files are already in the upload folder.

1001.pdf
1003.pdf
1029.pdf

I would like to have a script that would read the list of all pdf-files and store them in an array or another table.

# Whenever a visitor is in the detailed view of entry with entry_id=1003, then a link for downloading it should be visible. For example:
[pre]
Download document
[/pre]

# If there is no corresponding file in the folder, then there should not be a link for a file for downloading.

I would be glad to get some tips from you. Thanks.



[pre]
PHP Version: 7.1.8
mysql version: 5.5.5-10.1.26-MariaDB
Web server: Apache/2.4.27 (Win32) OpenSSL/1.0.2l PHP/7.1.8
Client: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
[/pre]
 
Top