Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : Re: problem loading pictures of web page using TidHTTPServer and TPageProducer

www.cryer.info
Managed Newsgroup Archive

Re: problem loading pictures of web page using TidHTTPServer and TPageProducer

Subject:Re: problem loading pictures of web page using TidHTTPServer and TPageProducer
Posted by:"Remy Lebeau (TeamB)" (no.spam@no.spam.com)
Date:Tue, 27 Jun 2006 23:25:06

"Glen Welch" <glen@custommadesoftware.co.nz> wrote in message
news:44a2097a@newsgroups.borland.com...

> This is the only coding I have - sorry only new to using
> the http server so am probably missing something...

When the webbrowser wants to download an image for a page, it has to send a
new request to the server.  You are passing the requested image path back to
the page producer, rather than serving up the image file directly.  You need
to look at the requested file path and then decide how best to handle it, on
a per-file basis.

For that matter, why are you using the page producer at all?  Why not just
serve the HTML files directly?  You can't use a page producer to generate
non-HTML files.

> The page index.htm was written using Front Page and contains 3
> images that do not display when the page is loaded into IE

That is because you are not handling the image files properly at all.

> when I use HTTPServer.ServeFile(AThread, AResponseInfo, LocalDoc)
> all works fine.

Of course it does, because you are serving the actual files as-is from the
hard drive without any processing on them.  If the files exist, the raw data
is sent to the browser as-is.  That is not the case when you try to use the
page producer and ignore non-HTML files, which you are currently doing.


Gambit

Replies:

none

In response to:

www.cryer.info
Managed Newsgroup Archive