Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
There's more than one way to do things
 
PerlMonks  

Re: Re: CGI.pm file upload freaking me out

by ryddler (Monk)
on Jan 07, 2001 at 04:01 UTC ( [id://50315]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: CGI.pm file upload freaking me out
in thread CGI.pm file upload freaking me out

Take a second look at the regex he used.

if ($file_name !~ /\.jpe?g$/)

The way he's using it covers both .jpg as well as .jpeg extensions in case the user tries to upload with either extension. However Trimbach, you might consider adding a "?" after the "g" as well, because as rare as it really is, .jpe is also an acceptable extension used with jpegs.

ryddler

Replies are listed 'Best First'.
Re: Re: Re: CGI.pm file upload freaking me out
by chipmunk (Parson) on Jan 07, 2001 at 16:21 UTC
    On the other hand, /\.jpe?g?$/ would also allow .jp, so this might be more suitable: if ($file_name !~ /\.jp(?:eg?|g)$/)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://50315]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.