delphi - How do I download only a little part of a big file? -


how download little part of big file in delphi? (like download manager)

for example, suppose want first 300 bytes of 100mb text file on http.

getting first 300 bytes of 100mb file.

using wininet library can specify in parameters how many bytes beginning of file need.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa385103.aspx


in case later want chunk in-between may investigate 3rd-party libraries. libraries need set http request range header - https://en.wikipedia.org/wiki/list_of_http_header_fields

however server may ignore header. library choose should check if server retirned content-range in http response , if did not. maybe download file start or maybe throw exception. should test libraries , understand behaviour in such case.


Comments