Panta Posted November 20, 2009 Share Posted November 20, 2009 Please friends please help me on how to display a picture that is in the data base on a browser, so that the user can see his uploded picture, and if possible print. thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted November 20, 2009 Share Posted November 20, 2009 Which fields do you have in the database? Do you have the binary data and the original filename or extension? Link to comment Share on other sites More sharing options...
Panta Posted November 20, 2009 Author Share Posted November 20, 2009 Which fields do you have in the database? Do you have the binary data and the original filename or extension?yes i have both in my data base, so i need help on how to display the image so that thet user will see it on the browser Link to comment Share on other sites More sharing options...
jlhaslip Posted November 20, 2009 Share Posted November 20, 2009 can you list the db table structure, please. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 20, 2009 Share Posted November 20, 2009 Basically, all you need to do is output the correct content-type header based on what the original extension was, and then output the binary data. e.g., if the image is a PNG:header('Content-Type: image/png');header('Content-Length: . ' strlen($image_data));echo $image_data;You can use a script that outputs that as the src for an image tag, e.g.:<img src="get_image.php"> Link to comment Share on other sites More sharing options...
chibineku Posted November 20, 2009 Share Posted November 20, 2009 header('Content-Length: '. strlen($image_data));Quote and concatenator were back-to-front... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.