LcDownloadedFile = "d:\temp\wwipstuff.zip" Next I do a second request to pick up the existing file and download the remainder: #INCLUDE wconnect.h To demonstrate this feature I used wwHTTP (in Web Connection/VFP) to download a first 400k chunk of a file into a file with HTTPGetEx which is meant to simulate an aborted download. There are more combinations but the first two are the ones that are of interest for a resumable download. Which download the first 100000 bytes, everything over 100000 bytes or the last 100000 bytes. However it turns out HTTP 1.1 does have the ability to specify ranges in downloads by using the Range: header in the Http header sent form the client. My first response to this question was that this isn't possible since HTTP is a stateless protocol that has no concept of file pointers and thus can't resume an HTTP download. ( ) A couple of days ago somebody on the Message Board asked an interesting question about how to provide resumable HTTP downloads. Have a look at 's copy of for more info on resuming HTTP downloads: Maybe the HTTP RANGE header can help you here. := IntToStr(fFileStream.Position) + '-' := IntToStr(fFileStream.Position) + '-'+ IntToStr(aRangeEnd) WorkBegin:TWorkBeginEvent Work:TWorkEvent WorkEnd:TWorkEndEvent) įFileStream := TFileStream.Create(LocalFile, fmCreate) įFileStream := TFileStream.Create(LocalFile, fmOpenReadWrite) įFileStream.Seek(Max(0, fFileStream.Size-4096), soFromBeginning) It downloads the file by chunks: procedure Download(Url,LocalFile:String
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |