Insert images into blob field in MySQL

From: Date: Mon, 03 Jun 2002 09:23:07 +0000
Subject: Insert images into blob field in MySQL
Groups: php.db 
Request: Send a blank email to php-db+get-19582@lists.php.net to get a copy of this message
Hi, i am having a problem with my mysql database inserting images in a blob field. I upload files from a form using the following code: if (isset($binFile) && $binFile != "none") { $data = addslashes(fread(fopen($binFile, "r"), filesize($binFile))); } else { $data = ""; } Then I insert $data into field DATA with a simple UPDATE query. The problem is that when file size is larger than ~100 Kb the insert is not done. And with smaller sizes, for instance 80 Kb, it makes the insert, but when i get the image back to the browser, it appears cut, i can see about half image only, and size is always 65535 bytes. Is maybe any limitation in the way i do the upload? Because i think the max size for a blob field is 16 Mb. Any help will be greatly appreciated. Thx in advance to everyone reading this post, jm

« previous php.db (#19582) next »