in reply to Re: Re (tilly) 4: Quick Regex question
in thread Quick Regex question

Why won't something like this work? What problems were you having with CGI?
<form enctype='multipart/form-data' ...> <input type='file' name='file' ...> <input type='file' name='file' ...> (repeat) use CGI ':standard'; use File::Basename; foreach (param('file')) { my $basename = basename($_); $basename =~ tr/A-Za-z0-9.//cd; # strip out unwanted crap open(FILE, "> $basename") or die "$basename: $!"; print FILE <$_>; close(FILE); }
You may have to tweak fileparse_set_fstype to match the OS of the client (see File::Basename and CGI, perhaps using $ENV{HTTP_USER_AGENT}). I haven't tested this, but is something like this what you were wanting to do?

Replies are listed 'Best First'.
Re: Re: Re: Re (tilly) 4: Quick Regex question
by merlyn (Sage) on Jan 14, 2001 at 08:58 UTC
      Speaking of stripping out unwanted crap... ;)