[AWS] Relative links

anders.wirzenius@wartsila.com anders.wirzenius@wartsila.com
Fri, 5 Dec 2003 10:57:18 +0200


Jacob Sparre Andersen wrote

>=20
> Anders Wirzenius wrote:
>=20
> > <img src=3D"icons/MSO014.png" width=3D"8px" height=3D" 34px"
> > alt=3D"29.08.2003: MSO014, 17 tickets">
> >=20
> > but no MSO014.png is found even if a have icons as a subdirectory=20
> > (..\HD\icons\) to the directory (..\HD\) where the AWS program is.=20
> > Aren=B4t the relative links relative to the directory where AWS is=20
> > running in?
>=20
> No!  Remember that HTTP is a stateless protocol.  The HTTP=20
> client interprets the HTML code an maps the relative URL into=20
> an absolute URL based on which URL the referring document was=20
> fetched from.
>=20
> I.e. this is not at all an AWS related question.

Thanx to both Jacob and Pascal.

I got it. I cannot expect the file to be found directly by referring in =
the HTTP code, I have to display it via a procedure in AWS:

<img src=3D"/display_image?img=3Dicons/adains.gif">
where
display_image ::=3D (in runme_CB.adb)
...
      elsif URI =3D "/display_image" then
         return Response.File=20
            (Content_Type  =3D> "image/png",
             Filename      =3D> Parameters.Get(P_List, "img")
             );
...


Anders

Pascal wanted people to tell what AWS is used for.=20
I use it for a tool in my company=B4s Help Desk where the operators may =
fetch data from Active Directory and other databases using a browser.
=20
The above image problem was in statistics about phone calls. I display =
the statistics as a one row HTTP table with images in the columns. Each =
column represents one day and each person has its own color. The column =
is build up by putting <img> tags in the column with <br> in between. =
The image files are 1x1 pixels large png files and are stretched to =
appropriate height and width,like:
<TD>
<img src=3D"icons/MSO014.png" width=3D"8px" height=3D" 34px" =
alt=3D"29.08.2003: MSO014, 17 tickets"><br>
<img src=3D"icons/AWI003.png" width=3D"8px" height=3D" 16px" =
alt=3D"29.08.2003: AWI003, 8 tickets"><br>
</TD>
The MSO014 ansd AWI003 are Help Desk operator=B4s access codes in our =
network. The color for MSO014 is produced automatically using Steve =
Sangwine=B4s program for creating png files. The values for the colors =
(RGB) for MSO014.png are=20
for R: ((Character'Pos('M') + Character'Pos('0')) mod 6) * 51;
for G: ((Character'Pos('S') + Character'Pos('1')) mod 6) * 51;
for B: ((Character'Pos('O') + Character'Pos('4')) mod 6) * 51;