Need Perl help

Discussion in 'Programming' started by wasistdas, Jul 14, 2006.

  1. #1
    I have a GIF at www.site.com/img/my.gif
    On a page a need to show it this way: <img src="http://www.site.com/cgi-bin/my.cgi">

    What I have to write in my.cgi to show my image?
     
    wasistdas, Jul 14, 2006 IP
  2. acplus

    acplus Guest

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need to set the content types in the CGI file. Normally when you print text/HTML you place this in the CGI script:

    print "Content-type: text/html\n\n";

    This will allow you to print all HTML on the CGI pages without throwing a 500 internal server error.

    The one you need to use will be:

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

    Once this is placed you can then stream the file by opening it, and printing the contents. Just like you would when reading a regular text file and displaying output.

    Hope this helps.

    Regards,
    acplus
     
    acplus, Jul 15, 2006 IP