Re: Help, can't seem to get this write

From: Date: Sat, 20 Jan 2001 09:32:12 +0000
Subject: Re: Help, can't seem to get this write
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-35793@lists.php.net to get a copy of this message
> 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

« previous php.general (#35793) next »