J
Jeff Thies
I have a multipart form with several fields including an imput
type="file" that needs to be FTP'd elsewhere. The file input may be
quite large.
If I were to read in the file using CGI.pm, CGI.pm would slurp in the
entire "file" into a temp file, potentially exceeding the storage quota.
I think I'm going to have read from STDIN directly.
my $flag=0;
while(<STDIN>){
if($_=~/^-------/){ # reset if form boundary, do all form boundaries
start like that?
$flag=0;
}
if($flag){&appendFTP($_)}
if($_=~/name="name_of_file"/){ # look for form name
$flag=1;
}
}
That seems a bit simple and crude. Do I need to do this?:
$_ =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; (before
appendFTP)
Do I need to filter out the "Content-type: ...\n\n" that seems to start
the file?
What else have I overlooked?
Jeff
type="file" that needs to be FTP'd elsewhere. The file input may be
quite large.
If I were to read in the file using CGI.pm, CGI.pm would slurp in the
entire "file" into a temp file, potentially exceeding the storage quota.
I think I'm going to have read from STDIN directly.
my $flag=0;
while(<STDIN>){
if($_=~/^-------/){ # reset if form boundary, do all form boundaries
start like that?
$flag=0;
}
if($flag){&appendFTP($_)}
if($_=~/name="name_of_file"/){ # look for form name
$flag=1;
}
}
That seems a bit simple and crude. Do I need to do this?:
$_ =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; (before
appendFTP)
Do I need to filter out the "Content-type: ...\n\n" that seems to start
the file?
What else have I overlooked?
Jeff