On Sep 9, Paul Kraus said:

>Query:
>test.cgi?fname=&lname=&file=C%3A%5CDocuments+and+Settings%5Cpdk%5CDeskto
>p%5Cascii-full.gif

That's not a file upload.  That's a simple get query.  A query with a file
upload takes place over POST, not GET.  Furthermore, you need to specify
the encoding type in the <FORM> tag.

  <form method="post" action="test.cgi" enctype="multipart/form-data">
  Choose file to upload:
    <input type="file" name="getme">
  <input type="submit" value=" Get File ">
  </form>

>#!/usr/bin/perl -wT
>
>use strict;
>use warnings;

That's very good, but the -w isn't needed if you have 'use warnings'.

>use CGI;
>use constant BUFFER_SIZE => 16_384;
>my $cgi = new CGI;
>my $buffer = "";
>my $file = $cgi -> param  ( 'file' );
>my $fh   = $cgi -> upload ( $file  );

That's not how uploading works.  You don't use the 'upload' method to
physically upload a file, you use it to access the form field that
represents the uploaded file.

  my $fh = $cgi->upload('getme');
  print while <$fh>;

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to