[reportlab-users] Image in a Python page

Andy Robinson andy at reportlab.com
Mon Jun 4 02:50:34 EDT 2007


On 02/06/07, David Frank <david83 at sfsu.edu> wrote:

> Hi All,

> file. I've tried using the complete address of the image, as

> "http://localhost/cgi-bin/Newbars.gif" and also with

> "C:\Program Files\Apache Software

> Foundation\Apache2.2\cgi-bin\Newbars.gif" and even with a

> slash instead of a backslash such as "C:/Program Files/Apache Software

> Foundation/Apache2.2/cgi-bin/Newbars.gif" but it's of no

> use. I've also tried using the line, print "Content-type: image/gif", but it

> just ends up printing this on the page. Can someone please give me an

> insight as to what I am doing wrong.


cgi-bin is often a special directory for executables; the server may
be trying and failing to 'run the image' like another script.

Try making a new direcory under htdocs called 'images'. Try saving it
as '../images/newbars.gif'' (i.e. in htdocs, at the top) and refer to
it explicitly as '/images/newbars.gif' in your HTML. Then test it's
there with the browser manually.
there is nothing magic about 'images' as a directory name, but there
IS something magic about 'cgi-bin'.

- Andy


More information about the reportlab-users mailing list