htmanning has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks, I know this is a perl forum but perhaps someone will be able to help with this. I need a way to have users upload a file to our server and auto fill a filename form field. Right now they click a link and a new window pops out, they choose the file, upload it, but then they have to copy the filename into a filename field we have in their main browser window. I'd like to have it auto fill that field much like Blogger and other sites do. I'm sure there's some snippet of javascript but I haven't been able to find anything. Any help would be appreciated.

Replies are listed 'Best First'.
Re: Upload script help - auto fill form
by ikegami (Patriarch) on Nov 08, 2008 at 07:14 UTC
    Don't browsers provide the name of the file being uploaded when they upload a file? If so, why do you want your user to give the file name a second time?
Re: Upload script help - auto fill form
by rooneyl (Sexton) on Nov 10, 2008 at 01:07 UTC
    check out this link for a simple CGI upload script. It will uses a browse button to find the file, and uses this for the file name. If you want to me about with thw file name (you will need to to accomdate different OS's/browsers) use the File::Basename module.