How do I figure out what MIME-type to send?
For some I could imagine that you can guess frmo the filename extension, but the other ones? Are there a generic one for "data"?
Thanks for your previous answer!
// Magnus
Troels Arvin wrote:
You probably need to stop giving direct access to files. Instead:
Move the uploaded files out of any Apache DocumentRoot.
Then, write a PHP-wrapper which
1) Checks if the user is allowed to
access the file.
2) If yes, then set the correct MIME
content-type with some header()
calls.
3) You should probably also send out
some HTTP-headers making the file
cacheable in the browser, at least
for a couple of hours.
4) Output the file contents to the browser
via the readfile() function.