Re: Handling files

From: Date: Sun, 12 Aug 2001 21:49:56 +0000
Subject: Re: Handling files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-62350@lists.php.net to get a copy of this message
> $data[0] = addslashes(fread(fopen($picture1, "r"), filesize($picture1))); Gak. You are missing otu on all sorts of error-checking there... > to store files from a client machine but now I want to store files from a > webstie ie > http://servername.com/file.jpg Just use $picture1 = "http://servername.com/file.jpg"; You really should break this down into multiple steps. You can get rid of the filesize() call to save load, and just loop through fread(..., 1000000); and append the data to your $data[0] -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#62350) next »