How to Implement Resumable Download in Silex

狂风中的少年 提交于 2019-12-03 04:41:09

Implementing it is quite trivial if you have a the file on the drive. It is like paginating records from a table.

Read the headers, open the file, seek to the desired position and read the the size requested.

You only need to know a little bit about the headers from the request & response.

Does the server accept ranges:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Range_requests

HTTP 206 status for content ranges:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206

Info about the content range headers:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!