Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
The param(data) was used previously in another link and here i am interested in uploading data2 (this works fine). However, the form submited should call a different script dependent on the $filename. if $filename was data then the link would for example www.processdata1.com if $filename was data2 then link would be www.processdata2.com.$upload_dir = "/home/upload"; $query = new CGI; $filename = $query->param("data"); $filename = $query->param("data2"); $filename =~ s/.*[\/\\](.*)/$1/; $upload_filehandle = $query->upload("data"); $upload_filehandle = $query->upload("data2"); #read and upload the file open UPLOADFILE, ">$upload_dir/$filename"; etc
rather than having to separate forms how can i achieve this? Thanks<FORM ACTION="http://www.xxx" METHOD="post" ENCTYPE="multipart/form-data"> File to upload: <INPUT TYPE="file" NAME="data2"> <INPUT TYPE="submit" NAME="Submit" VALUE="Upload"> </FORM>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: form cgi
by cbrandtbuffalo (Deacon) on Jul 07, 2005 at 16:25 UTC | |
|
Re: form cgi
by jhourcle (Prior) on Jul 07, 2005 at 17:20 UTC | |
by Anonymous Monk on Jul 07, 2005 at 19:20 UTC | |
|
Re: form cgi
by ww (Archbishop) on Jul 07, 2005 at 16:50 UTC | |
|
Re: form cgi
by splinky (Hermit) on Jul 07, 2005 at 16:14 UTC |