我已经在远程服务器上运行了 wget。我的目标是在我的服务器上保存 9000 个文件,因为由于荒谬的安全措施,我获取它们的唯一方法是一次通过 GET 请求。
所以我正在运行:
C:\Program Files (x86)\GnuWin32\bin>wget --no-check-certificate --load-cookies c ookies.txt\-p https://username:[email protected]/folder/document/download/1type=attachment
现在,在浏览器中导航到上述 URL 将允许我将该网页下载为 .html 文件。但是,当我运行此命令时,我将文件另存为
1@type=attachment
它正在创建一个包含该文件的新文件夹链/website.webpage.com/folder/document/download/
。
我在这里误解/调用错误了什么?
最佳答案
您可以使用 --content-disposition
选项来尝试并遵守该 header (这可能是您的浏览器正在执行的操作)。
来自 wget
手册页:
--content-disposition
If this is set to on, experimental (not fully-functional) support for "Content-Disposition" headers is enabled. This can currently result in extra round-trips to the server for a "HEAD" request, and is known to suffer from a few bugs, which is why it is not currently enabled by default.
关于bash - wget 使用不正确的名称/类型保存文件。为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29282937/