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?


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to