I found info on php.net about how to set content type for a file & then cause it to be a downloaded file. So far it's been working for showing everything until I tried having it display a jpeg. Here's the code I have -
header("Content-type: ".$atype); readfile(include($afile)); The only problem is I get this error when it tries to display the jpeg - The image "http://localhost/pic/picdb.file.php?id=3" cannot be displayed, because it contains errors. I decided to have it print some stuff to check to make sure it was getting the correct info & here's what it printed out after my print statements. I left out the line about can't modify header info after printing other stuff as that's obvious - Warning: Unexpected character in input: '' (ASCII=15) state=1 in C:\apache\upload\splash.jpg on line 87 Parse error: parse error, unexpected T_STRING in C:\apache\upload\splash.jpg on line 87 Any ideas how to proceed? I would have it simply display the file instead except that this is displaying uploaded files that are not in web viewable directories. The reason for this is so the admin can view the file & determine whether it should be viewable or not prior to releasing it to the web. Either way, simply displaying the jpeg from a web viewable directory works. Patrick -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php