> function downloadfile($url, $imageDir)
>  {
>   if(!$file = fopen($url , "r"))
>    {
>     echo ("couldn't open $url\n");
>    }
>   else
>    {
>     #fpassthru($file);
>     if($file2 = fopen("/www/sinead/images/Full/Sinead200.jpg", "w"))
>      {
>       $content=fread($file, filesize("$file"));
>       fwrite($file2, $content, filesize("$file"));

Having quotes on the $file arguments to filesize() is not right...
Hey, doesn't filesize() take the *path* to a file, not a file pointer?
Yeah, it does:  http://php.net/filesize
So, like, you're asking for the filesize of a file named '1' or whatever the
file pointer id number is.
Actually, I don't think you can get a filesize() of a URL anyway...

You're going to just have to get like a million bytes or whatever you think
convenient, and loop until you got it all.

>       echo ("$file2 created");
>      }
>    }
>  }
> ?>


By Day:                                |By Night:
    Don't miss the Zend Web Store's    |   There's not enough room here...
    Grand Opening on January 23, 2001! |   Start here:
    http://www.zend.com                |   http://l-i-e.com/artists.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to