saurabh220837:

You're using "C:/Apache24/images/tree.jpeg" as the image source. I can guarantee you that that's not the URL that will access the file.

As people have mentioned to you, you'll need to check the apache configuration to find out how to tell it where the image is.

For example, if I set up a web server, I might configure it like this:

Alias /images C:/Apache24/images/ DocumentRoot D:/CoolWebsiteProject/html Alias /cgi-bin D:/CoolWebsiteProject/bin

So as far as the outside world is concerned "https://YourWebsite.com/images/tree.jpeg" would be the location that the outside world would use to access your image file. Similarly, "https://YourWebsite.com/cgi-bin/index.cgi" would be coming from D:/CoolwebsiteProject/bin. That's why you need to look at your configuration. Any time you're putting something like "C:/local/path/to/file" in an web page, you're doing it wrong.

...roboticus

When your only tool is a hammer, all problems look like your thumb.


In reply to Re^3: Image doesnot display in perl cgi when moved code from linux to windows by roboticus
in thread Image doesnot display in perl cgi when moved code from linux to windows by saurabh220837

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.