[AWS] embedding an image into a html response

Ian Broster ian at broster.co.uk
Sun Jul 23 17:37:19 CEST 2006


> Clearly this would only return one image to the user,
> with no html. How are css,images,or javascript files
> to be included into response?

When you include HTML like <img src="/dw.gif" alt="a picture" /> then the  
browser sends a _separate_ request back to the server to GET the image (if  
the browser wants to display the image that is, and assuming it is not  
cached etc).

So, you must still implement a rule to tell the server how to create  
/dw.gif, in a similar way to to proposed with a png image.

This is very easy for images that do not change (are not related to the  
page that they are displayed on. If the contents of dw.gif are dynamic and  
depend on data in the page, then you need to add data to the IMG tag, for  
example: <img src="/dw.gif?id=123&amp;data=456" alt="my specific picture"  
/>; this uses the arguments in a GET request.

Alternatively something like <img src="dw/123/456/image.gif" alt="my  
specific picture that has it's own URL" /> can be effective.

HTH

Ian

-- 
Ian Broster


More information about the AWS mailing list