 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Graham Harris Guest
|
Posted: Thu May 03, 2007 11:09 am Post subject: Sending a generated JPEG as a response |
|
|
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
|
Posted: Thu May 03, 2007 1:28 pm Post subject: Re: Sending a generated JPEG as a response |
|
|
OK fixed it
Do not need:
Response.SetCustomHeader('Content-disposition', 'attachment;filename=Map.jpg');
Graham Harris |
|
| Back to top |
|
 |
Graham Harris Guest
|
Posted: Thu May 03, 2007 2:05 pm Post subject: Re: Sending a generated JPEG as a response |
|
|
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
|
Posted: Thu May 03, 2007 6:24 pm Post subject: Re: Sending a generated JPEG as a response |
|
|
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 |
|
 |
|
|
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
|
|