I have a website that shows products with a PDF to download (per product).
The exact name of the PDF is unknown, what we do know is that all the PDF’s contain an unique number and some other unknown characters.
Is it possible to make a script with PHP that searchs the folder and finds the filename of the PDF that matches the unique number of the product and return this as a link for the download button (for that product)?
Example of a PDF name is:
‘12344.2021-this is variable.pdf’
The first part ‘12345.2021’ is a unique number.
Anyone an idea? 🤔