开发者

Download the last parts of a file, using Ruby?

开发者 https://www.devze.com 2023-04-11 21:06 出处:网络
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.

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

精彩评论

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

关注公众号