Re: File To Blob Corruption
| From: | Nisse Engström | Date: | Sun, 15 Nov 2009 21:14:14 +0000 |
| Subject: | Re: File To Blob Corruption | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-299851@lists.php.net to get a copy of this message | ||
On Sat, 14 Nov 2009 17:39:20 -0800, Don Wieland wrote:
> Hello,
>
> I am trying to create an UPLOAD page to Update a Images and PDFs into
> a BLOB field in mySQL. The image keeps getting corrupted (it draws a
> portion of the image and the rest is GRAY) We tried it with Safari and
> Firefox with bad results.
>
> Here is the QUERY to upload the image (saveDialog.php):
>
> if($_POST['obj'] == "uploadImage") {
> $file = $db->real_escape_string(file_get_contents($_FILES['img']
> ['tmp_name']));
> $db->query("UPDATE Areas SET Image = '$file'") or
> die("1".$db->error);
Random ideas:
* Select the image from the database and compare it to $file.
Are they identical?
* Run a hex dump on the images before and after upload.
What is the difference?
/Nisse