read the specs on copy() it copys a source file to a destination file... You are not copying files!... You should use something like fwrite to write the contents of $image to a file...
Andrew ----- Original Message ----- From: "Jan Grafström" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 08, 2001 8:28 AM Subject: [PHP] copy image from database > Hi! > I have images in my DB and want to write them to disk. I tried to copy but > nothing happend, > the image only pops up in my browser with "echo". I want it saved in a > directory on my server. > ----- > $query = "select bin_data,filetype from $table where id=$id"; > $result = @MYSQL_QUERY($query); > $image = @MYSQL_RESULT($result,0,"bin_data"); > echo $image; > $destfile="image.jpg"; > copy($image,$destfile) > ----- > Thanks for any help > Regards, > Jan > -- > Jan Grafström > Lillemans Hus AB > Sweden > 46 (0)611-60920 > 46 (0)70-6409073 > > > -- > 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] > > -- 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]