Re: [PHP-DB] Still trying to get image from /tmp path
Maybe this helps: $file = "/tmp/pathtoimage/image.jg" $fp = fopen($file, filesize($file)); $image = fread($fp, filesize($file)); //not sure about fread function¿ print $image //or imagejpeg($image), I'm not sure.. Grtz, Luc [EMAIL PROTECTED] - Original Message - From: "Mark Gordon" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, July 29, 2001 10:31 PM Subject: [PHP-DB] Still trying to get image from /tmp path > Thanks, David. That helped a little but now what I get is: > in the output. > > The tmp folder is up the directory tree outside of my www folder (on my > web host's 'puter)- I don't have direct access to it. > > Heres the modified code: > > $sql=mysql_query("SELECT bin_data FROM binary_data WHERE id=4"); > $row = mysql_fetch_array($sql); > header("Content-type: image/jpeg"); > echo ""; > > How can I use the path stored in the db to retrieve the image? > > = > Mark > [EMAIL PROTECTED] > > __ > Do You Yahoo!? > Make international calls for as low as $.04/minute with Yahoo! Messenger > http://phonecard.yahoo.com/ > > -- > PHP Database 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 Database 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]
RE: [PHP-DB] Still trying to get image from /tmp path
No no no, what you want to do is echo $row[0], not . $row[0] is the actual jpeg data, and the browser will interpret it like that since you put the header("Content-type: text/jpeg"); Try echoing $row[0] only and tell me how that goes. -- David -Original Message- From: Mark Gordon [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 29, 2001 1:31 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Still trying to get image from /tmp path Thanks, David. That helped a little but now what I get is: in the output. The tmp folder is up the directory tree outside of my www folder (on my web host's 'puter)- I don't have direct access to it. Heres the modified code: $sql=mysql_query("SELECT bin_data FROM binary_data WHERE id=4"); $row = mysql_fetch_array($sql); header("Content-type: image/jpeg"); echo ""; How can I use the path stored in the db to retrieve the image? = Mark [EMAIL PROTECTED] __ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ -- PHP Database 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 Database 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]