Feb 11, 2001, 1:03 PM
Post #1 of 4
I havn't worked with regular expressions much, so this is probably pretty easy. I'm trying to get the extension of an uploaded image file. I tried this, but it just stripped the drive letter:
determining file extension of uploaded image
>> If you can't control it, improve it, correlate it or disseminate it with PERL, it doesn't exist!
$filehandle = $q -> param("pic");
$extension = substr($filehandle, $filehandle =~ /.(gif|jpg|jpeg)$/i);