Re: recognising plain text files

From: Date: Thu, 16 May 2002 15:23:42 +0000
Subject: Re: recognising plain text files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-97922@lists.php.net to get a copy of this message
The uploaded mime type is set by the browser, not by PHP. So I guess in your Netscape case it isn't sending the right type. Perhaps have a look at the 'file' UNIX-level command and use that. -Rasmus On Thu, 16 May 2002, Lee P Reilly wrote: > Hi, > > I am doing some validation on files that are being upload. I only wish > to allow users to upload files that are in *plain text* format (not > neccessarily with a .txt extension). I have the following piece of code, > which works fine in IE, but in Netscape Navigator: > > if ($file_type != "text/plain") > ... error handling... > > Can anyone explain the reason for this, or offer a better solution? > > Thanks, > > Lee > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#97922) next »