I have a HttpHandler which will do some checks on the incoming requests and in certain cases perform some function. One of the conditions that needs to be checked is whether the request is a byte-range request. How is this done?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to look for a
Rangeheader in theRequestobject that’s part of theHttpContextpassed to yourProcessRequestmethod. There is noRangeproperty in theHttpRequestclass, so you’ll have to look in theHeaders. If there is aRangeit will be of the form:Range: bytes=<start>-<end>Where
<start>and<end>are integers. For example, if somebody wanted 64K from the middle of a file:Range: bytes=32768-98304You’ll have to parse the text into numbers and handle accordingly.