BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How does websnap / page producer handle images?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet WebSnap
View previous topic :: View next topic  
Author Message
Alex
Guest





PostPosted: Mon Feb 26, 2007 9:11 am    Post subject: How does websnap / page producer handle images? Reply with quote



The question is do I have to handle image requests from my
Webdispatcher if I am using the page producer?

I am using websnap with the web dispatcher, instead of page dispatcher

I have the images set up in the webappdebugger path; so thats not it

here some sample code.. of what I am trying to do:

I want to dynamically locate the file being requsted and load into a
page producer and send the content stream out. What happens when I use
the webapp debuger and I dont specify a file just root request (/)
the page gets displayed with images, looks fine, and I only get one
request for the page.

When I request /index.html I get request for index.html and every
single image in the html file.

Do I also need to implement support for handling the images aswell as
the pages?

Doesnt the page producer handle the image requests?

Any help / info on this is appreciated

Thanks

procedure TWebAppDataModule2.FindView(PathInfo:string);
begin
ModulePath:=ExtractFilePath(ModuleFilename);
PagePath:='Pages'+StringReplace(Pathinfo,'/','\',[rfreplaceAll]);
if Copy(PagePath,1,1)='\' then Pagepath:=ContentPath
+'\'+Copy(Pagepath,2,Length(PagePath));

if PathInfo='/' then
begin
pp.htmlfile:=Modulepath+'pages\index.html';
Webcontext.Response.Content:=pp.content
end
else
begin
if Pos('.html',Pagepath)>0 then
if FileExists(ModulePath+Pagepath) then
pp.HTMLFile:=Modulepath+Pagepath;
WebContext.Response.Content:=pp.content;

end;
end;

procedure TWebAppDataModule2.WebDispatcherBeforeDispatch(Sender:
TObject; Request: TWebRequest; Response: TWebResponse; var Handled:
Boolean);
begin
Handled:=true;
FindView(Request.InternalPathinfo);;
end;
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet WebSnap All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.