in reply to Uploading Time

This has been asked about a lot. One recent discussion is here. The answer is that there are many ways to do it. :)

I recommend using File::Basename as a portable solution.

Hope it helps.

jarich

Replies are listed 'Best First'.
Re: Re: Uploading Time
by rob_au (Abbot) on Jun 14, 2002 at 11:41 UTC
    I cannot agree more strongly with this approach involving File::Basename suggested by jarich, it being the same which I employed, with HTTP::BrowserDetect for portability, for the file name determination in the CGI::Upload module.

    From the CGI::Upload module ...

    # Determine and set the file system parsing routines # based upon HTTP client header information. # fileparse_set_fstype( sub { my $browser = HTTP::BrowserDetect->new; return 'MSWin32' if $browser->windows; return 'MacOS' if $browser->mac; $^O; } ); my @file = fileparse($cgi->param($param), '\.[^\.]*'); # Return undef if file name cannot be parsed from file # field parameter # return undef unless $file[0];