Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Dec : problem loading pictures of web page using TidHTTPServer and TPageProduce

www.cryer.info
Managed Newsgroup Archive

problem loading pictures of web page using TidHTTPServer and TPageProduce

Subject:problem loading pictures of web page using TidHTTPServer and TPageProduce
Posted by:"Glen Welch" (gl..@custommadesoftware.co.nz)
Date:Tue, 6 Dec 2005 16:46:17 +1300

How do I reply to my previous message - could only add this as a new item
sorry....


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

procedure TIMain.HTTPServerCommandGet(AThread: TIdPeerThread;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  LocalDoc: String;
begin
  LocalDoc := ExpandFilename(ExtractFilePath(Application.ExeName) + '\web
site' + ARequestInfo.Document);
  if not FileExists(LocalDoc) and DirectoryExists(LocalDoc) and
FileExists(ExpandFileName(LocalDoc + 'index.htm')) then
  begin
    LocalDoc := ExpandFileName(LocalDoc + 'index.htm');
  end;

  if FileExists(LocalDoc) then // File exists
  begin
    htmlPageProducer.HTMLFile := LocalDoc;
    AResponseInfo.ContentText := htmlPageProducer.Content;
    AResponseInfo.ContentType := 'text/html';
  end;
end;

The page index.htm was written using Front Page and contains 3 images that
do not display when the page is loaded into IE- when I use
HTTPServer.ServeFile(AThread, AResponseInfo, LocalDoc) all works fine.

Replies:

www.cryer.info
Managed Newsgroup Archive