I think you should not focus so much on the file extension, as that is mostly 
meaningless if someone wanted to attack your system.

Instead, you could wrap a call to the command line 'file' command, which gives 
mostly accurate information about a file. Basically it reads the first few 
bytes to see it is what it expected. There is a php wrapper for this, but I 
forget what its called just now.

If you do need to just grab a file extension though, you can do it with a call 
to pathinfo() with the 2nd argument of PATHINFO_EXTENSION.

Thanks,
Ash
http://www.ashleysheridan.co.uk

----- Reply message -----
From: "Jordan Jovanov" <jovanovj...@gmail.com>
Date: Mon, Sep 6, 2010 14:46
Subject: [PHP] Hi
To: <php-general@lists.php.net>
Cc: <jovanovj...@gmail.com>


Hi All

I need me a little help.
I create scripte for upload file is work very good but the problem is next:
I neet to upload only .zip file i need to disable some user to shoise to 
upload another file Extensions.

Can somebody help me.

Thanks a lot.

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

Reply via email to