Re: MIME type detection on file

From: Date: Wed, 21 Feb 2001 15:43:51 +0000
Subject: Re: MIME type detection on file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-40972@lists.php.net to get a copy of this message
when your uploading a file <input type=file name=db_file> php will create three variables, $db_file $db_file_name $db_file_type $db_file_type should have the mime/type. now should does NOT mean will. some browsers (I dont have a list) will not send the correct type at all. you can use linux's file command [lee@server streaming]$ file usermanual.pdf usermanual.pdf: PDF document, version 1.3 [lee@server streaming]$ this will not give you the mime-type though. you can also use grep this will only give you what the server thinks is the mime-type, not what the client feels the mime-type is [lee@server streaming]$ grep "pdf" /etc/mime.types application/pdf pdf [lee@server streaming]$ If your just curious of what a mime/type is without uploading it (I dont think you are) then youve answered your own question. "Files are on local disk. Not accessible from web server. " if php can not access the files then how could it possibly ever find this files mime-type ? -- Chris Lee Mediawaveonline.com em. lee@mediawaveonline.com ph. 250.377.1095 ph. 250.376.2690 fx. 250.554.1120 "Andris Jancevskis" <ajandris@parks.lv> wrote in message news:25167573397.20010221163036@parks.lv... > Hi, > > is there suggestions how to determine what mime type is file? > for example: > .word -> application/wnd-word > .pdf -> application/pdf > > Files are on local disk. Not accessible from web server. > > I'm interesting to determine it on linux (Apache) and win32(IIS 4.0) > platforms. > > TIA, > -- > Andris > mailto:ajandris@parks.lv > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#40972) next »