Ich weis immernoch nicht, wie ich jetzt ein Bild mit Hilfe von Perl uploaden
kann. Der Code da unten erzeugt immer nen Fehler:
Software error:
syntax error at singles.pl line 266, near "/([\w.-]+)/;"
Execution of singles.pl aborted due to compilation errors.
Welchen Content Type muss ich dann in der form nochmal angeben??? Und was
ist param('upload')?
For help, please send mail to this site's webmaster, giving this error
message and the time and date of the error.
> [back to the list]
>
> At 10:24 PM 5/29/01 +0000, you wrote:
> >But i have already programmed a Guestbook, and a Password protection for
a
> >Webcam. Also i have programmed a color Voting Program fpr my Homepage,
and a
> >program that shows the stats of the votes. Now I'm working at a Site
where
> >singles can add their Information, and find other users. That's where the
> >problem with the file sending came up, because i'd like to give the Users
a
> >chance to upload a picture from them.
> >So if you could give me a small code that saves an uploaded picture in a
> >definded directory I would be happy!
>
> use CGI qw(:all);
> use CGI::Carp qw(fatalsToBrowser);
> my $fh = param('upload');
> my ($name) = ($fh =~ /([\w.-]+)/;
> open (OUT, ">$name") or die "Can't open $name: $!";
> my $buf;
> print OUT $buf while read $fh, $buf, 1024;
> close OUT;
>
> I doubt you'll find many people who want to reinvent the CGI.pm wheel for
> you. If you've learned all those other things it won't take you long to
> pick it up.
>
> >thx
> >Bernhard
> >
> > > At 07:45 PM 5/29/01 +0000, Bernhard wrote:
> > > >But I'm not using CGI.pm. I don't know what i should do with it. I
only
> >want
> > > >to use Perl.
> > >
> > > Unfortunately one has to walk before one can run. Your response is
akin
> >to
> > > saying, "I don't want to use a boat; all I want to do is sail across
the
> > > Atlantic using this pile of cloth and wood."
> > >
> > > If you plan to do anything else with web programming in perl, your
most
> > > cost-effective solution is to learn CGI.pm and to learn whatever else
you
> > > need to learn in order to learn CGI.pm. If this is all you want to
do,
> > > your most cost-effective solution is to find someone else to do it for
> >you,
> > > probably at a fee. Sorry; that's just the way it is.
> > >
> > > --
> > > Peter Scott
> > > Pacific Systems Design Technologies
> > > http://www.perldebugged.com
> > >
> > >
>
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com
>
>