curl测试断点续传功能
2017-12-26 15:31
155 查看
环境说明
使用公司的文件下载服务器,测试其断点续传功能,文件服务器采用fastdfs搭建,文件小于50M直接使用流传输,准备下载url,查询其文件大小为3208578字节,断点下载,先下载0-90000字节,再下载90000-结束字节。root@dev:~/test# curl -H "Range: bytes=0-90000" http://192.168.96.35:8080/FileService/downloadstorefile.do?fileid=349933937 -v > test.m4a * Trying 192.168.96.35... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.168.96.35 (192.168.96.35) port 8080 (#0) > GET /FileService/downloadstorefile.do?fileid=349933937 HTTP/1.1 > Host: 192.168.96.35:8080 > User-Agent: curl/7.47.0 > Accept: */* > Range: bytes=0-90000 > < HTTP/1.1 206 < Server: nginx/1.1.10 < Date: Tue, 26 Dec 2017 07:19:35 GMT < Content-Type: application/octet-stream;charset=UTF-8 < Content-Length: 90001 < Connection: keep-alive < Content-Disposition: attachment; filename="349933937.m4a" < Last-Modified: Mon, 25 Dec 2017 02:37:11 GMT < ETag: 349933937 < Accept-Ranges: bytes < Content-Range: bytes 0-90000/3208578 < { [1089 bytes data] 100 90001 100 90001 0 0 4092k 0 --:--:-- --:--:-- --:--:-- 4185k * Connection #0 to host 192.168.96.35 left intact root@dev:~/test# ll test.m4a -rw-r--r-- 1 root root 90001 12月 26 15:21 test.m4a root@dev:~/test# curl -H "Range: bytes=90000-" http://192.168.96.35:8080/FileService/downloadstorefile.do?fileid=349933937 -v > test.m4a * Trying 192.168.96.35... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 192.168.96.35 (192.168.96.35) port 8080 (#0) > GET /FileService/downloadstorefile.do?fileid=349933937 HTTP/1.1 > Host: 192.168.96.35:8080 > User-Agent: curl/7.47.0 > Accept: */* > Range: bytes=90000- > < HTTP/1.1 206 < Server: nginx/1.1.10 < Date: Tue, 26 Dec 2017 07:19:49 GMT < Content-Type: application/octet-stream;charset=UTF-8 < Content-Length: 3118578 < Connection: keep-alive < Content-Disposition: attachment; filename="349933937.m4a" < Last-Modified: Mon, 25 Dec 2017 02:37:11 GMT < ETag: 349933937 < Accept-Ranges: bytes < Content-Range: bytes 90000-3208577/3208578 < { [2529 bytes data] 100 3045k 100 3045k 0 0 10.5M 0 --:--:-- --:--:-- --:--:-- 10.5M * Connection #0 to host 192.168.96.35 left intact root@dev:~/test# ll test.m4a -rw-r--r-- 1 root root 3118578 12月 26 15:22 test.m4a
可以看出文件下载服务断点功能正常,下载的文件大小一致。
相关文章推荐
- HTTPie:替代 Curl 和 Wget 的现代 HTTP 命令行客户端
- cURL操作Openstack对象存储的ReST API详解
- C# 文件下载之断点续传实现代码
- PowerShell中使用curl(Invoke-WebRequest)的方法教程
- C#文件断点续传实现方法
- Android多线程断点续传下载示例详解
- php下目前为目最全的CURL中文说明
- PHP curl_setopt()函数实例代码与参数分析
- php curl上传、下载、https登陆实现代码
- php采用curl访问域名返回405 method not allowed提示的解决方法
- php中file_get_content 和curl以及fopen 效率分析
- php中curl和file_get_content的区别
- php实现curl模拟ftp上传的方法
- php 使用curl模拟ip和来源进行访问的实现方法
- PHP简单开启curl的方法(测试可行)[原创]_php技巧_脚本之家
- php使用curl实现简单模拟提交表单功能
- php使用curl实现ftp文件下载功能
- php断点续传之文件分割合并详解