Richard Davey wrote:

> BH> I want to test an uploaded file to see if it is a text file, but I don't want
> BH> to rely on the presence of an os command such as 'file.'  Is there a
> BH> straightforward way to do this within PHP?  Thanks in advance.
> 
> Yes, check the $_FILES['userfile']['type'] after upload.

I tried this initially, but the problem is that it relies on the client's 
interpretation of the file type.  With the files I used for testing, Konqueror and
other reported the MIME type as text/plain, but Mozilla reported it as
application/octet-stream.  What I am looking for is a way to test the file
depending only upon PHP.  i.e., to be platform and client independent.

-Bob

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to