Perl: Uploading a file from a web page
I am trying to upload a file from a web page without using:
my $query = CGI->new;
my $file开发者_JS百科name = $query->param("File");
my $upload_filehandle = $query->upload("File");
My form has several input fields and only one of them is a file name. So when I parse the form I parse all of the input fields in one pass. This means that I have the filename withough using my $filename = $query->param("File");
but, as far as I can tell, this means I can't use my $upload_filehandle = $query->upload("File");
to do the actual uploading.
Any advice is appreciated.
Regards.
How are you parsing the input fields? More importantly why are you using CGI
and reimplementing some of its functionality?
This should still work:
my %args = how_you_are_parsing_the_url();
my $query = CGI->new; #this parses the url as well
my $upload_filehandle = $query->upload("File"); #assuming the input is named File
精彩评论