From: Date: April 27 1999 3:51pm Subject: Re: [PHP3][MySQL] Upload file into database List-Archive: http://lists.mysql.com/mysql/2472 Message-Id: <00d501be90b5$02c99c00$cb00a8c0@stuart.alba-networks.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > I have a MySQL database and I want to upload pictures into a blob >attribute via web. I know how to upload a file but I don't know how to >insert it into my blob. don't know if it's the best way to do it, but seems to work OK. $fp = fopen('big.file.jpg', 'r'); $jpg = fread($fp, filesize('big.file.jpg)); fclose($fp); $db->query("update table set blob_field = '".base64_encode($jpg)."' where ... JC