In HttpWebRequest AddRange method, we can specify the range of byte to download. What I want to know is how to specify my range from a certain offset upto the end of file.
Like if we don't know the length of the file, we can specify like this in the Request Header string
"Range: bytes = 0 - " This means, starting from the first byte upto the end of file.
But using the method AddRange, how to specify this with one offset value to the EOF??
I know I can get the content length and specify like this, AddRange(0, ContentLength). But I am asking if there is any way to get the contents upto EOF from a certain 'offset' value.
You use a positive value to the AddRange method to get bytes from the offset to the end of entity;
request.AddRange(10)
Tells the server to return all bytes except the first 10.
You can use a negative value, which is the ending point;
request.AddRange(-10)
Tells server to return bytes 0 to 10.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With