RTC Forums
November 24, 2024, 06:23:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Partial Download from RtcHTTPServer->DataProvider  (Read 4423 times)
nmgoza
RTC Expired
*
Posts: 5


« on: July 30, 2012, 02:38:57 PM »

I am currently able to use DataRequest and DataProvider objects. DataRequest requests required files and DataProvider responds by supplying requested files. My question relates to a scenario where there is a loss in connection.What can be suggested as a way of continuing from last Written part of the file.After re-requesting the file,what can be suggested as a way of telling the Servers DataProvider that I only request data from the last written bytes?
Hope my question makes sense.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: July 30, 2012, 02:59:09 PM »

This is usually done by utilizing the "Range" (Request) and "Content-Range" (Response) HTTP header. Client will set the "Range" HTTP header to let the Server know what part of the file it wants to download, and the Server will use the "Content-Range" HTTP header to let the Client know what part of the file is being returned.

Naturally, it is not enough to simply set these HTTP headers. You also need to implement your DataProvider and DataRequest events to read and write file parts accordingly.

For example, the RTC WebServer Demo uses "Range" and "Content-Range" HTTP headers to allow file download resuming. Open the "rtcFileProvider.pas" unit and search for 'RANGE' and 'Content-Range' to find the corresponding implementations for the Server side.

For a detailed definition of the "Range", "Content-Range" and other HTTP header fields, please visit:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Best Regards,
Danijel Tkalcec
Logged
nmgoza
RTC Expired
*
Posts: 5


« Reply #2 on: August 07, 2012, 04:02:31 PM »

Thank You very very much...will action as recommended.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 17 queries.