The simple answer to your question is that you cannot simply check the BLOB to see what file type it is once it's in MySQL. You can analyse the headers of the first few bytes of the blob but that's quite complicated.
The correct way to do this is when a user uploads the file, it's stored in a temporary location and you can access it (and move it to a more sensible place or your database). Check the mime type of the file using fileinfo:
http://php.net/manual/en/function.finfo-file.php
Then store the mime-type in a new column alongside the blob.
Update: If you are using PHP < 5.3.0 then this solution allows you to check the mimetype using an older (now deprecated) function: https://stackoverflow.com/a/8225754/775007