
roolic
User
Apr 14, 2010, 11:14 PM
Views: 4215
|
|
Re: [ankit] HOW TO SEE PNG image in browser
|
|
|
you should not mix text and binary data (image) within single server response. because the browser is not able to process such data. The most simple way to show the image within the html is just printing the refernece to an image. The browser will fetch and place it by itself (with separate request as it always does). for example if you store your image into some local_path/images/ folder which is visible from web as http://your_host/web_path/images/ and the image name is some_image.png the code will be following:
print header; # this prints content-type: text/html .... print "Total Fragments of the sequence are: @count \n"; print "</pre></code>\n", hr; my $img_filename = 'some_image.png'; print "<img src=\"/web_path/images/$img_filename\"><br />";
(This post was edited by roolic on Apr 14, 2010, 11:15 PM)
|