Links On Web wrote at Fri, 14 Jun 2002 07:20:17 +0200:

> for some reason when, I do this it doesnt print any thing, it just makes the file.
> 
> sub uploadfile {
> for ($i=1; $i<=5; $i++) {
>       if ($q->param("file$i")) {
>         $filename = $q->param("file$i");
>         $file = $q->param("file$i");
>         $filename =~ s/.*[\/\\]//;
> 
>         open (FILE,">$user{'site_id'}/$filename") ||
> &error("Could not create $filename: $!");
> {
>      local $/="";
>      my $uploaded = <$file>;
>      print FILE $uploaded;
> }
> close FILE or die "$!";
> 
> 
> 
>       }
> }

I'm also not an expert of uploading files.
But you do two things to read the file:

$file = $q->param("file$i");
Now $file contains a string.

Then you use something like
my $uploaded = <$file>;

So now you use $file as a Filehandle,
but in fact it's still a simple stupid string.


Greetings,
Janek

BTW: 
"Links on Web" and email adress [EMAIL PROTECTED] doesn't seem to be very serious.
You should become more serious if you really want something else than junk mail.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to