RE: [PHP-WIN] File Upload type
| From: | Asendorf, John | Date: | Wed, 15 Nov 2000 18:47:21 +0000 |
| Subject: | RE: [PHP-WIN] File Upload type | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-3875@lists.php.net to get a copy of this message | ||
try using a regular expression:
You'll need to change the extension here.
if ( eregi ("[a-zA-Z0-9_-]*.txt" , $file_name )) { }
for multiple extensions, you might need to change it to... uh...
if ( eregi ("[a-zA-Z0-9_-]*.(txt|jpg|gif)" , $result_name )) { }
(or something like that, I forget off the top of my head...
John
----------------------
Founder of
The 'What Kind of Idiot Uses PHP with IIS with Oracle on NT?' Consortium
Members: John Asendorf, Thomas Kryger, Florian Clever, Ron Woods
John Asendorf - jasendorf@lcounty.com
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Caesar si viveret, ad remum dareris.
> -----Original Message-----
> From: Ben Cairns [mailto:BenC@intasept.com]
> Sent: Wednesday, November 15, 2000 10:24 AM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] File Upload type
>
>
> I have a working file upload script,
>
> I need to ensure that only a certian file type is uploaded to
> the server,
> how can I check this. Just being able to check the file
> extension would do.
>
>
> -- Ben Cairns, Head Of Technical Operations, Intasept.com
> E-Mail: BenC@intasept.com | Web:
> http://www.intasept.com
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>