Articles on correct Mime Types for different file extensions or content types.
These Mime Types may be used from within PHP and other programming languages when delivering content through the HTTP protocol.
Instead of trying to handle serving of static files yourself, you can use Beamtic's File Handler Library
Using a file extension to determine the Mime Type is not always reliable or safe, but it is the recommended way to determine the content of a file that you have control over. The reason for this is, file extensions are actually very user friendly. Only for user-contributed files should you take extra steps to verify that a file is what a user claims it is.
Saving files without extensions, while it is possible, is not recommended.
It is also possible to store files in a database, but this is usually not recommended. Instead, you could store the absolute path to the file in the local file system.