开发者

Download the last parts of a file, using Ruby?

Looking at this question: Reading Remote MP3 File's ID3 Tags using Java

It looks like it's possible to download just the tail end of a file. At least, HTTP supports it.

There is also: How to do开发者_如何学JAVAwnload via HTTP only piece of big file with ruby which relates to downloading only the beginning of a file.

Using Ruby, I'd like to download just the last pieces of a remote file. All I have is a URL.


You have create a range request (partial download), here is the info how to do it: How to make an HTTP GET with modified headers?

You'll need the size of the file, so you need another request to fetch only the headers to parse that info, preferably with a HEAD command (or a GET with Range: bytes=0-0).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜