Home Copy ResourceStream In Stream
Reply: 0

Copy ResourceStream In Stream

user1249
1#
user1249 Published in April 26, 2018, 5:13 pm

This question already has an answer here:

  • Why am I getting “Abstract Error” when working with TStream class? 1 answer

I need help in this code

This is all code

Request: TIdHTTPRequestInfo

Response: TIdHTTPResponseInfo

JQuery: TResourceStream

procedure TServer.ActiveServer;
begin
  DefaultPort := 8117;
  Active := True;
  OnCommandGet := FServerCommandGet;
  JQuery := TResourceStream.Create(HInstance,'JQuery',RT_RCDATA);
end;

function TServer.FindFiles: Boolean;
var
  Stream : TStream;
begin
  if Request.Document = '/jquery.js' then
  begin
    Response.ContentType := 'application/x-javascript';
    Stream := TStream.Create;
    Stream.Position := 0;
    Stream.CopyFrom(JQuery,JQuery.Size);
    Response.ContentStream := Stream;
    Result := True;
  end else
    Result := False;
end;

error : TStream.Seek not implemented

The problem is in the copy TResourceStream in TStream

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309924 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO