Click to See Complete Forum and Search --> : PHP help -- determining Content-type for a given file.


Bradmont5
03-22-2002, 05:24 AM
I've got a PHP assignment where we have to allow downloading of an arbitrary file from the server, and I can't for the life of me figure out how to determine the appropriate Content-type header for a given file. I really don't want to have to check the file type manually, so can anyone enlighten me about any php library that might do this for me?

Stuka
03-25-2002, 12:30 PM
Isn't there a "generic" uuencoded (or similar encoding) type that you can use for this? That should provide the arbitrariness you're looking for...

RTFM
03-26-2002, 08:21 PM
application-x/unknown

:D