RE: no luck uploading
On Mon, 1 Nov 1999, Tubbs, Derric L wrote: > Well, I finally got it to work with Apache::Request. I had to do "$args = > Apache::Request->new($r);" and "$file = $args->upload;" in the handler sub > and then pass $args and $file to any other subs that needed it. Maybe this > is normal but if so I was unaware of it. I was doing all of the above > within a different sub that gets called from handler. > > BTW, Can I do a conditional on the creation of $file that would return false > if there was no file uploaded??? just test for ->filename: if (my $upload = $apr->upload) { my $filename = $upload->filename; unless ($filename) { print "no file specified"; return; } ...
RE: no luck uploading
Well, I finally got it to work with Apache::Request. I had to do "$args = Apache::Request->new($r);" and "$file = $args->upload;" in the handler sub and then pass $args and $file to any other subs that needed it. Maybe this is normal but if so I was unaware of it. I was doing all of the above within a different sub that gets called from handler. BTW, Can I do a conditional on the creation of $file that would return false if there was no file uploaded??? > -- > From: Doug MacEachern[SMTP:[EMAIL PROTECTED]] > Sent: Monday, November 01, 1999 1:36 PM > To: Tubbs, Derric L > Cc: '[EMAIL PROTECTED]' > Subject: Re: no luck uploading > > On Mon, 1 Nov 1999, Tubbs, Derric L wrote: > > > I've been trying to use the "file" input field to upload some files and > I'm > > having no luck at all. I first tried using Apache::Request with no luck > and > > the error message "Can't call method "filename" without a package or > object > > reference at ..." but I had in fact done a $args = > Apache::Request->new($r) > > and $file = Apache::Request->upload. > > I don't understand what you are trying to say, without seeing an example. > try the libapreq-x.xx/eg/perl/file_upload.pl script >
Re: no luck uploading
On Mon, 1 Nov 1999, Tubbs, Derric L wrote: > I've been trying to use the "file" input field to upload some files and I'm > having no luck at all. I first tried using Apache::Request with no luck and > the error message "Can't call method "filename" without a package or object > reference at ..." but I had in fact done a $args = Apache::Request->new($r) > and $file = Apache::Request->upload. I don't understand what you are trying to say, without seeing an example. try the libapreq-x.xx/eg/perl/file_upload.pl script
RE: no luck uploading
Yes, it is. Here is the form: > -- > From: Ken Y. Clark[SMTP:[EMAIL PROTECTED]] > Sent: Monday, November 01, 1999 10:15 AM > To: Tubbs, Derric L > Cc: '[EMAIL PROTECTED]' > Subject: Re: no luck uploading > > On Mon, 1 Nov 1999, Tubbs, Derric L wrote: > > > I've been trying to use the "file" input field to upload some files and > I'm > > having no luck at all. I first tried using Apache::Request with no luck > and > > the error message "Can't call method "filename" without a package or > object > > reference at ..." but I had in fact done a $args = > Apache::Request->new($r) > > and $file = Apache::Request->upload. > > > > Then, just because I only found upload examples using it, I tried CGI.pm > (I > > don't use this anywhere else on my site). Now all I get is "Malformed > > multipart POST" messages in my error_log. > > > > I've tried using IE 4, NS 4.05 under windows and NS 4.04 under Solaris. > My > > config is Solaris 2.6 with Apache 1.3.6, Perl 5.004_04, Apache::Request > 0.31 > > and CGI.pm 2.54. I've pared down the form to the minimum with just a > form > > with one input field. Also, I get the malformed message simply by doing > $q > > = new CGI, it doesn't matter if I try to do anything with it or not. > Any > > help would greatly appreciated. > > is your form "enctype" set to "multipart/form-data"? > > ky >
Re: no luck uploading
On Mon, 1 Nov 1999, Tubbs, Derric L wrote: > I've been trying to use the "file" input field to upload some files and I'm > having no luck at all. I first tried using Apache::Request with no luck and > the error message "Can't call method "filename" without a package or object > reference at ..." but I had in fact done a $args = Apache::Request->new($r) > and $file = Apache::Request->upload. > > Then, just because I only found upload examples using it, I tried CGI.pm (I > don't use this anywhere else on my site). Now all I get is "Malformed > multipart POST" messages in my error_log. > > I've tried using IE 4, NS 4.05 under windows and NS 4.04 under Solaris. My > config is Solaris 2.6 with Apache 1.3.6, Perl 5.004_04, Apache::Request 0.31 > and CGI.pm 2.54. I've pared down the form to the minimum with just a form > with one input field. Also, I get the malformed message simply by doing $q > = new CGI, it doesn't matter if I try to do anything with it or not. Any > help would greatly appreciated. is your form "enctype" set to "multipart/form-data"? ky