如何在Internet上获取文件版本但不下载? [英] how can I get the file version on the Internet but not download it?

查看:132
本文介绍了如何在Internet上获取文件版本但不下载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个文件网址,例如 http://cidian.youdao.com/下载/ YoudaoDict.exe

I get a file url,for example, http://cidian.youdao.com/download/YoudaoDict.exe

我怎样才能获得它的版本但不能下载它?

how can I get it's version but not download it ?

不知道1:如果您先在计算机上下载文件,有很多方法可以获得它

nots 1: if you download the file first on your computer,there are many ways to get it's

版本,例如,您可以使用窗口工具filever.exe 得到版本。

version, for example ,you can use the window tools "filever.exe" to get the version.

但我想不下载它,至少不下载全部。我可以做什么?等待你的

but i want to not download it ,at least not download it all.how can I do? Waiting your

帮助!谢谢。

nots 2:我试过获取文件的一部分来获得版本:

nots 2: I have tried the way to get a portion of the file to get the version:

首先,我使用下载工具wget.exe下载了一部分文件(wget.exe是

first, I used the download tool "wget.exe" to download a portion of the file ( wget.exe is

单线程下载工具,它可以确保从头部下载)

a single-threaded download tool,it can make sure download form the head)

第二,我使用filever.exe获取文件版本。

second, I used the "filever.exe" to get the file version.

通过这种方式,一些软件我可以得到它的版本,但有些不能(它们必须全部

In this way, some software i can get it's version,but some cann't(they must all be

下载)。我不知道为什么。

downloaded).I don't know why.

推荐答案

我注意到特定的exe链接支持字节范围请求。

I notice that that particular exe link supports byte range requests.

$ curl -I http://cidian.youdao.com/download/YoudaoDict.exe
HTTP/1.1 200 OK
...
Accept-Ranges: bytes
Content-Length: 4820792
...
Content-Type: application/octet-stream

您可以发出一个或多个HTTP字节范围请求,以获取确定版本所需的文件部分。你只是要提出几个请求来获取你在硬盘上看到的文件部分。

You could make one or more HTTP byte range request to get the parts of the file you need to determine the version. You'd just be making several requests to get the parts of the file you'd look at if it were on your hard drive.

例如,基于< a href =http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html\"rel =nofollow noreferrer> HTTP / 1.1规范,您可以使用此请求请求前500个字节header:

For example, based on the HTTP/1.1 spec, you can request the first 500 bytes with this request header:

curl -H"Range: bytes=0-499" http://... -o bytes-0-499.dat

这篇关于如何在Internet上获取文件版本但不下载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆