in reply to grabbing text

From the CGI.pm docs:
Different browsers will return slightly different things for the name. Some browsers return the filename only. Others return the full path to the file, using the path conventions of the user's machine. Regardless, the name returned is always the name of the file on the I<user's> machine, and is unrelated to the name of the temporary file that CGI.pm creates during upload spooling (see below).
You don't need to know the directory in your cgi because (if you do everything right) the file contents are transmitted to your .cgi along with any other fields in the form when the users does the form submit. The server does not open a separate connection back to the web browser to get the file.

Replies are listed 'Best First'.
RE: RE: grabbing text
by KM (Priest) on May 25, 2000 at 00:55 UTC
    If you didn't strip this, I bet most people will end up with something like:

    $ ls
    hello.txt
    c:\upload\foo.doc
    c:\temp\send.txt
    etc...
    
    :).. this is how CGI.pm gets the file name:

    my($filename) = $header{'Content-Disposition'}=~/ filename="?([^\";]*)"?/;

    lhoward did point out that some clients do send the full path. I need to look deeper into the CGI.pm source when I have an extra tuit.

    Cheers,
    KM