If I understand this correctly, you are not sending or receiving files in
chunks. On the HTTP protocol level I mean. You are solely interested in
passing a TFileStream instead of a TMemoryStream. So if the server you are
connecting to limits the file upload to fe. 10 MB, then that's it: 10 MB is
your limit. If you are using a slow line and the file you receive is sent by
a PHP script that has a timeout of say 30 secs, then you are stuck with a
low receive limit. My understanding of your original question of chuncked
transfer was that you were trying to address these issues.
 
Ludo
 
 
-----Message d'origine-----
De : Krzysztof [mailto:dib...@wp.pl] 
Envoyé : mercredi 11 mai 2011 21:37
À : synalist-public@lists.sourceforge.net
Objet : [Synalist] RE : THTTPSend - posting and receiving big files



Ok, 

I wrote my own descendant:

  TMyHTTPSend = class(THTTPSend)
  private
    function MyReadUnknown(AFile: TFileStream): Boolean;
    function MyReadIdentity(AFile: TFileStream; Size: Integer): Boolean;
    function MyReadChunked(AFile: TFileStream): Boolean;
  public
    function UploadFile(const Method, URL, AFileName: string): Boolean;
    function DownloadFile(const Method, URL, ADestFileName: string):
Boolean;
  end;   

Which use code from HTTPMethod but instead of
FSock.SendBuffer(Document.Memory) it uses FSock.SendStream(f) and
FSock.ReadStream(f) where "f" is TFileStream and it works like a charm :D .
Great that all methods and local variables are in protected section. Now I
can upload and download very big files without loading them to memory and
with all THTTPSend functionality (OnHeartBeat, OnStatus etc) 




Regards

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to