httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith C. Perry" <>
Subject Re: Problem use Apache::Upload
Date Fri, 30 Jul 2004 13:45:54 GMT
Quoting Markus Wichitill <>:

> Keith C. Perry wrote:
> > Quoting Markus Wichitill <>:
> >>If you want an Apache::Upload object, you need to pass a field name:
> >>my $upload = $req->upload('foo');
> >>
> >>
> > 
> > I saw that but the way the docs read, its sounds like you don't need a
> parameter
> > there.  
> It says if you don't pass a name, you get an Apache::Upload::Table object in
> scalar context.
> my $uploads = $req->upload();
> my $upload = $uploads->{'foo'};

Ok, I see

> This is different from the apreq1 API, but passing the name works for both 
> versions.
>  > Also when you say field name... field name to what? Is this arbitary?
> The name you gave the HTML form field.
> <input type='file' name='foo'>

I thought that might had been it but I tried a couple of things while I was
waiting.  First here is the form:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.or
<title>File Upload</title>
<form name="uploadform" action="upload.mpl?1" method="post" enctype="multipart/f
<input name="sentfile" type="file">
<input value="Send File" type="submit">

Now, I tried...

my $upload = $req->upload('sentfile');
my $fname  = $upload->filename('origname');

I get this error...

[Fri Jul 30 09:40:12 2004] [error] Can't call method "filename" on an undefined
value at /www/local/upload.mpl line 18.\n

BTW, you used curly braces in your example to me but I'm assuming that was a
typo.  :)  For my own sanity I tried

my $upload = $req->upload{'sentfile'};

and it does give me a syntax error.

Keith C. Perry, MS E.E.
Director of Networks & Applications
VCSN, Inc.
This email account is being host by:
VCSN, Inc :

View raw message