Re: Is it possible to test an uploaded file to check the type?
| From: | Jason Wong | Date: | Sat, 12 Jul 2003 17:38:05 +0000 |
| Subject: | Re: Is it possible to test an uploaded file to check the type? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-154961@lists.php.net to get a copy of this message | ||
On Sunday 13 July 2003 01:24, Dan Anderson wrote:
> Is it possible to check a file in $_FILES['userfile']['tmp_name'] to
> make sure it is of a certain format? I want to allow a user to only
> upload jpegs or mpegs, and want to check what format the file is in.
If on un*x you can use the 'file' program. Also search on freshmeat.net, I
believe there is a php-based program which gives info on the common media
type files.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Beauty, n.:
The power by which a woman charms a lover and terrifies a husband.
-- Ambrose Bierce
*/