FTP and HTTP resume?

Andre Garzia andre at andregarzia.com
Wed Jul 11 09:52:17 EDT 2007


David,
for the FTP Resume is not that hard if you use your own socket commands,
instead of using RETR to get the file you use REST (I think) and pass the
offset as a parameter. The server will proceed just like RETR but will start
sending from the offset.

(IIRC)

Andre

On 7/11/07, David Bovill <david at openpartnership.net> wrote:
>
> On 11/07/07, Dave Cragg <dave.cragg at lacscentre.co.uk> wrote:
>
> For resuming http downloads, take a look at using the Range header in
> > the httpHeaders. It would look something like this (untried):
> >
> >    set the httpHeaders to "Range: bytes=1000-1999"
>
>
> This seems the best option... so I'd need to know how many bites I had
> downloaded... if I use:
>
>       libURLDownloadToFile downloadURL, filePath, "http_DownloadComplete"
>
> Then after stopping I would need to work out how many bites were
> downloaded-
> i think that is equivalent to the number of chars of the binary file:
>
> put the number of chars or url "binfile:partially_downloaded.mov" into
> > numberOfBites  -- ???
> >
>
> It seems that this method will be dependent on the server supporting it -
> I
> guess most Apache servers will? But more ftp servers seem to... a good
> starting point is to check the "put libURLLastRHHeaders()" - If the
> received
> headers contain an ETag line - things are looking promising:
>
> ETag: "162bcb8-2571-eefb9fc0"
> >
>
>
> References
> Below are some links for reference if anyone else needs to look into this:
>
> I found the following reference - but it may be a bit windows / IE
> specific:
>
>    - http://www.devx.com/dotnet/Article/22533/0/page/2
>    - http://www.lassosoft.com/Documentation/TotW/index.lasso?9233
>
> Taken from - http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
> #sec14.16
>
> Examples of byte-content-range-spec values, assuming that the entity
> contains a total of 1234 bytes:
>
>       . The first 500 bytes:
>        bytes 0-499/1234
>
>       . The second 500 bytes:
>        bytes 500-999/1234
>
>       . All except for the first 500 bytes:
>        bytes 500-1233/1234
>
>       . The last 500 bytes:
>        bytes 734-1233/1234
>
> When an HTTP message includes the content of a single range (for example,
> a
> response to a request for a single range, or to a request for a set of
> ranges that overlap without any holes), this content is transmitted with a
> Content-Range header, and a Content-Length header showing the number of
> bytes actually transferred. For example,
>
>        HTTP/1.1 206 Partial content
>        Date: Wed, 15 Nov 1995 06:25:24 GMT
>        Last-Modified: Wed, 15 Nov 1995 04:58:08 GMT
>        Content-Range: bytes 21010-47021/47022
>        Content-Length: 26012
>        Content-Type: image/gif
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



More information about the use-livecode mailing list