Posted by splodge on 01/30/06 23:05
This may seem like a stupid question but I want to check before I go
ahead and build this...
I am working on a portal, part of which allows users to upload files.
Part of the array within $_FILES superglobal gives the mime type for the
file. Is this 100% reliable / accurate? If the mime type says the file
type is jpeg is it always right? Two reasons I want to know:
1. Certain types of files mustn't be uploaded, .exe files for example.
2. It is unsafe to rely on file extentions, not least because this
portal will be exposed to Linux.
If the mime type is not reliable what techniques are available to
discover the type of a file?
Many thanks.
Navigation:
[Reply to this message]
|