Re: Check type of uploaded file
| From: | Bob Hockney | Date: | Mon, 08 Dec 2003 00:12:08 +0000 |
| Subject: | Re: Check type of uploaded file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-172136@lists.php.net to get a copy of this message | ||
Gerard Samuel wrote:
> On Saturday 06 December 2003 11:01 pm, Richard Davey wrote:
> > Yes, check the $_FILES['userfile']['type'] after upload.
> >
> That can be spoofed.
> There isn't really a way to determine file types...
I was thinking of trying something like ereg("[[:print:]]*", "$contents") on the
file. Not really what I want, but would reject obvious non-text files.
-Bob