Here's what going on.
# $file is now assigned the name of a file, which has been uploaded using
your form.
my $file = $q->param( "file" ) || error ($q, "No file received.");
# the 'upload' subroutine has the same usage as 'param', but is used for
file uploads.
# so instead of passing $file to 'upload' you should be passing "file".
# (this is according to the CGI docs.) 'upload' returns a filehandle, while
'param' returns
# a file name. this may be your problem.
my $fh = $q->upload( $file );
If you want to use the subroutine 'uploadInfo' then you will need to
retrieve the filename
from the CGI object using 'param', but for a filehandle you should use
'upload'.
Hope this helps.
Bradley M. Handy
Senior Programmer/Owner
Jack-of-all-trades Programming Services
--www.jack-of-all-trades.net
--mailto:[EMAIL PROTECTED]
> -----Original Message-----
> From: Lynn Glessner [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 21, 2001 2:51 PM
> To: Bradley M. Handy
> Subject: Re: Upload script
>
>
> I don't want to repost to the whole list again, so I'll just send to you.
> Would appreciate any insight you have. I have CGI.pm 2.76
>
>
>
> ----- Original Message -----
> From: "Bradley M. Handy" <[EMAIL PROTECTED]>
> To: "Lynn Glessner" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, August 21, 2001 11:14 AM
> Subject: RE: Upload script
>
>
> > If you have downloaded the latest version of CGI, then that may be your
> > problem. CGI.pm versions 3.0 and above are ALPHA code and shouldn't be
> used
> > in production environments. (I don't even use that version in test
> > environments.) The latest STABLE version of CGI.pm was 2.753,
> but I think
> > now it maybe 2.76. (Check you local CPAN dealer for more details.) In
> any
> > case, you should download the latest 2.x version of CGI.pm and use that.
> >
> > If you ARE using the latest 2.x version of CGI.pm, then could you post
> your
> > code so we can have a look at it. Or, is that not possible.
> >
> > Bradley M. Handy
> > Senior Programmer/Owner
> > Jack-of-all-trades Programming Services
> > --www.jack-of-all-trades.net
> > --mailto:[EMAIL PROTECTED]
> >
> > > -----Original Message-----
> > > From: Curtis Poe [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, August 21, 2001 1:40 PM
> > > To: Lynn Glessner; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: Re: Upload script
> > >
> > >
> > > --- Lynn Glessner <[EMAIL PROTECTED]> wrote:
> > > > The name of my upload file isn't literally file, it is contained in
> the
> > > > variable named file. I agree that the upload method is probably
> > > my problem;
> > > > someone else said it was just buggy. :(
> > >
> > > I don't necessarily know that this method is buggy. I was just
> > > pointing out that many people have
> > > had difficulties with it. For some, it's an older version of
> > > CGI.pm. For others, it's misuse,
> > > and others circumstances, it just seems to 'fail'. Maybe it's
> > > bugs, maybe it's some confusion
> > > over the documentation. I've just seen enough problems with
> > > enough programmers that I avoid it.
> > >
> > > Cheers,
> > > Curtis Poe
> > >
> > > =====
> > > Senior Programmer
> > > Onsite! Technology (http://www.onsitetech.com/)
> > > "Ovid" on http://www.perlmonks.org/
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make international calls for as low as $.04/minute with
> Yahoo! Messenger
> > > http://phonecard.yahoo.com/
> > >
> > > --
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]