Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 5th, 2001, 05:17 AM
bindu bindu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Hyderabad
Posts: 0 bindu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Post How to display an image from a database

Hello,

I have an image saven in mysql database column. I want to extract that from the database and display it on the html page using PERL script. I am able to read from the database but to send it back to html page .. I need to set the mime type. What is the statement that I should write? Generally when we send html stuff then we write the statement as

print "content-type:text/html\n\n"

what if in the case of image?

Please help me in this matter.

Thanks in advance.

Bindu.

Reply With Quote
  #2  
Old July 5th, 2001, 06:26 AM
len123 len123 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2001
Location: Ipswich
Posts: 0 len123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

Why don't you just reference the file name, and write out the image tag on the fly? Or is there a reson the image must be stored within th DB

cheers

Len

Reply With Quote
  #3  
Old July 6th, 2001, 01:03 AM
bindu bindu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Hyderabad
Posts: 0 bindu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for the reply. Actually I want to avoid the problem of uploading the images manually. I would like to save them in the database directly and retrieve them from the database while displaying them. This would be very much useful in the case of displaying the banners randomly, and for the dynamic content management. So, I want the solution for the above problem.

Bindu.

Reply With Quote
  #4  
Old July 6th, 2001, 01:28 AM
bindu bindu is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Hyderabad
Posts: 0 bindu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I got it...

Well, I got the solution for my problem.

The line that we mention is

print "content-type:image/gif\n\n";


Bindu.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > How to display an image from a database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway