At 02:50 AM 6/2/01 +0000, Bernhard wrote:
>syntax error at singles.pl line 266, near "/([\w.-]+)/;"
>Execution of singles.pl aborted due to compilation errors.
Sorry, typo on that line, should be:
my ($name) = ($fh =~ /([\w.-]+)/);
>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;
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com