in reply to How do I parse multipart/form-data?!?
The other important thing to note is that CGI::upload() will return a filehandle you can read the file from:<form action="/cgi-bin/upload.cgi" method="POST" enctype="multipart/fo +rm-data"> File to upload: <input type="file" name="file"> </form>
my $file = $q->param('file'); my $fh = $q->upload($file); my $buffer; open(OUTPUT, $output_filename) || warn "Can't create local file: $!"; # just in case you're not Unix binmode $fh; binmode OUTPUT; while ( read($fh, $buffer, 16384)) { print OUTPUT $buffer; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Re: How do I parse multipart/form-data?!?
by PipTigger (Hermit) on Jun 08, 2000 at 05:08 UTC | |
by takshaka (Friar) on Jun 08, 2000 at 10:53 UTC | |
by chromatic (Archbishop) on Jun 08, 2000 at 05:27 UTC |