Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Lighttpd's X-Sendfile2 header: resume streaming #67

Open
benoitbryon opened this issue Nov 24, 2013 · 0 comments
Open

Support Lighttpd's X-Sendfile2 header: resume streaming #67

benoitbryon opened this issue Nov 24, 2013 · 0 comments

Comments

@benoitbryon
Copy link
Collaborator

http://redmine.lighttpd.net/projects/1/wiki/Docs_ModFastCGI#X-Sendfile

If the HTTP client needs to resume a download it will send a HTTP header called "Range"
In case of a download resume (for instance when using wget -c), the header will be like "bytes=2375680-"
See RFC2616 section 14.35.2 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2

And

send the "X-Sendfile2: filename range" header (available since 1.4.24)
The filename has to be urlencoded (including encoding ',' as '%2c': str_replace(',', '%2c', urlencode($path));)
Range has the form "start-end" (inclusive end) or "start-" (from start until file end); you must always specify the range, use "0-" for the complete file.
Example: X-Sendfile2: /tmp/test.txt 0-499 sends the first 500 bytes from /tmp/test.txt.
You can send this header more than once with different parameters (or you can combine single values with ", " between them).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant