in reply to select directory with CGI.pm

As stated by others (and the documentation), the path is not dependably returned by the user's browser. So, if you're really lucky, you might be able to find this in $filename = param('uploaded_file');. Of course, this assumes that the user actually uploads a file. Probably not what you want but it is a faint possibility.

What I've done to get around a similar problem is to have (intranet) users start the process with a local program (VBS in my case) which gets the required info from the local system and opens an internal webpage with the appropriate parameters to do the work.