... php read filename extension in database ...



• php - read filename extension in database »»


Hi,

I wonder if anyone can help me with this. I have a recordset to get the names of files to download, these are mostly PDFs so I have added the code to output a PDF file. If the file is not pdf I want to output it in the correct format.

So PHP Code:
if (file is pdf) {
// We'll be outputting a PDF
header('Content-type: application/pdf');
// called download.pdf
header('Content-Disposition: inline; filename="download.pdf"');
// The source of the PDF
readfile("../pathtofile/".$row_rsFilelist['filename']);

} else {
//we'll output probably just a link
}

any help would be appreciated.

Thanks :)
 Bookmark with:            
Source: IrishWebMasterForums | pub: 16 Oct 2008 by: Dotwebs | added: 16 Oct 2008 | cat: Coding Help | views: 20 time/s
Related Articles...
Leave a Comment...
Name: *
Email: *
Comment: *
Security Code: security code
*
     Remember me:
Categories
Channels
Press Release