Msg#: 3834018 posted 11:53 pm on Jan 24, 2009 (gmt 0)
how do i get file type from mysql uploaded file using php example something which will out like .zip .tar etc i have different type of files in a table and there is nothing which will say what type is it any code to out with php ?
Msg#: 3834018 posted 12:23 am on Jan 25, 2009 (gmt 0)
no getting my point some more details here i am saying about header("Content-type: "); i have files in mysql table but i dont no the type of files there are different different files like .zip .gif and only longblob and id to get nothing is saying the type so is there any way to get the file type and show using header("Content-type: TYPE HERE");
Msg#: 3834018 posted 5:58 pm on Jan 26, 2009 (gmt 0)
For certain image types you can use the PHP exif_imagetype [php.net] function. Anything other than images you may have to use either a system command as mentioned. PHP once had a function called mime_content_type [us.php.net] but that has been deprecated. File Information [php.net] is looking to be it's replacement.