P
Piet van Oostrum
Ferrous Cranus said:This is addon domain's counter.py snippet tried to load an image mail.png and failed because it cant see past its document root
========================================
# render html template and print it
data = f.read()
counter = '''<center>
<a href="mailto:[email protected]"> <img src="/data/images/mail.png"> </a>
<table border=2 cellpadding=2 bgcolor=black>
<td><font color=lime> ΑÏιθμός Επισκεπτών </td>
<td><font color=cyan> %d </td>''' % hits[0]
========================================
While from within the same counter.py file
# open html template file
f = open( '/home/nikos/public_html/test.txt' )
opens OK the page file which is also past addons domain's document root
Can you help counter.py to load the image? Why does it fail to load it? Python can have access to ANY filesystempath , no matter from what folder counter.py script runs from. Correct?
That piece of code is not opening the image file. It just issues the URL
for the image file. The file will then be loaded by the browser in a new
request. The image should be at
/home/nikos/public_html/data/images/mail.png
P.S. I don't understand what you mean by "addon domain".