[PHP] list pdf files in a directory

Soldato
Joined
1 Feb 2006
Posts
8,188
hi, a mate is looking me to create a simple page in PHP which navigates through a directory and creates links to all the pdf files in that directory. This is simple but what I want to know is there any way of adding a file description as the hyperlink instead of using the filename? I don't want to be using a database for this. I was thinking along the lines of EXIF data on images. Are there are attributes of a PDF file that I can access with PHP and set as a clickable link to the file? Probably a long shot but worth a try!
 
hi, a mate is looking me to create a simple page in PHP which navigates through a directory and creates links to all the pdf files in that directory. This is simple but what I want to know is there any way of adding a file description as the hyperlink instead of using the filename? I don't want to be using a database for this. I was thinking along the lines of EXIF data on images. Are there are attributes of a PDF file that I can access with PHP and set as a clickable link to the file? Probably a long shot but worth a try!

try this, makes directories look pretty :)
 
you can list what's in the directory using glob, but I don't think there's any way to do your summary thing without a database of some description. You could use xml, but it obviously wouldn't update on the fly (hate that phrase)
 
The process is possible, but long and expensive (in terms of making you, as the user, sit there and rot whilst it churns through the files.)
 
thanks for the replies guys, i think il just go with the using globals method as i want to easily incorporate the listing into an existing page template. Meaningful file names will have to do.
 
Back
Top Bottom