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 

Sending a generated JPEG as a response

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker
View previous topic :: View next topic  
Author Message
Graham Harris
Guest





PostPosted: Thu May 03, 2007 11:09 am    Post subject: Sending a generated JPEG as a response Reply with quote



Hi

I have a ISAPI DLL that interfaces with a service that generates a JPEG image.
I can, in a regular Win32 Application, retreive the image, and this seems
to be happening in the ISAPI program. Once I get the image this is the code
that I am using the following method to send the data:

procedure TwmMain.SendResponse(Response: TWebResponse; Image: TStream; FileName,
ContentType: AnsiString);
begin
Response.ContentType := ContentType;
Response.SetCustomHeader('Content-disposition', 'attachment;filename=Map.jpg');
Response.SetCustomHeader('Accept-Ranges', 'bytes');
Response.SetCustomHeader('Content-Length', IntToStr(Image.Size));
Image.Seek(0, soFromBeginning);
Response.ContentStream := Image;
Response.SendResponse;
end;

In Opera I get prompted to save the file which then when I save the file
the file is not being streamed. In IE 7 the file is streamed and is OK, again
I am prompted if I want to save the image or not.
The idea is that I pass the URL to generate the image in the following manner:
<img src="http://localhost/WebTrack.dll/Tracking?Docket=1890&Height=800&Width=600"
/>.

I am using Delphi 2006 on Windows XP (Fully updated)

TIA

Graham Harris
Back to top
Graham Harris
Guest





PostPosted: Thu May 03, 2007 1:28 pm    Post subject: Re: Sending a generated JPEG as a response Reply with quote



OK fixed it

Do not need:
Response.SetCustomHeader('Content-disposition', 'attachment;filename=Map.jpg');

Graham Harris
Back to top
Graham Harris
Guest





PostPosted: Thu May 03, 2007 2:05 pm    Post subject: Re: Sending a generated JPEG as a response Reply with quote



Hello Del,

The question was why was the image not being sent to the browser.

Graham Harris

Quote:
Not sure what you queston is since you didnt' ask one???

Is it .. "Why is Opera not getting the file ???" ... or ..
Why does IE work and Opera doesn't ?? .. or is it a different
question. Your
post is just a statement.
Back to top
Del Murray
Guest





PostPosted: Thu May 03, 2007 6:24 pm    Post subject: Re: Sending a generated JPEG as a response Reply with quote

Not sure what you queston is since you didnt' ask one???

Is it .. "Why is Opera not getting the file ???" ... or ..
Why does IE work and Opera doesn't ?? .. or is it a different question. Your
post is just a statement.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Isapi-WebBroker 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.