Get original Documents/Notes pdf saved as files without extensions

Hi.

When I create notes for users and add documents to the note, this documents (pdf, xls...) are saved in upload folder as files without extension. If I download this documents from web I can download it as the original pdf. But I need to extract the pdf from the files with a .php script because I need to download a lot of documents and I can't  download all one by one. So I want to take the files from upload folder and take the files I need. But as I said this files are saved without extensions.

My goal is create a .php script to take all this files, but I don't know how extract the original .pdf or .xls from this files saved without extension. How I can download with a php script the original .pdf from this files without extenson?

Thanks.