Hi Doug,

Just a thought, I'm not familiar with CGI, but...

Is the Response.SendResponse-method by any chance non-blocking
(asynchronous)?
If so, you should wait freeing the filestream until all data has been sent.

Greetz,

Peter.


-----Oorspronkelijk bericht-----
Van: [email protected] [mailto:[email protected]]namens Doug
Hale
Verzonden: vrijdag 29 mei 2009 20:37
Aan: [email protected]
Onderwerp: [delphi-en] Problems downloading large files with Delphi7 CGI app





I am using Delphi 7 and Apache 2.2.10 on Windows XP Ver 2002 service pack 3

I have a CGI application that provides access to PDF files.

During the download of larger files, the CGI exe just unloads without
finishing the transfer.

My Code:
Filename := Path+Document+'.pdf';
Fs := TFileStream.Create(Filename, fmOpenRead, fmShareDenyNone);
Response.ContentType := 'application/pdf';
Response.ContentStream := Fs;
Start := DateTimeToTimeStamp(Now);
Response.SendResponse;
Fs.Free;

Response.SendResponse never returns, the exe just unloads.

Is there something I'm not doing that I should or something I did that I
shouldn't?

Doug

Reply via email to