bash - wget 使用不正确的名称/类型保存文件。为什么?

标签 bash unix authentication wget

我已经在远程服务器上运行了 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/

相关文章:

linux - 在 powershell 脚本中转义 bash 代码序列

java - Java 的 dir.listFiles() 和 *.nix 的 ls 有什么区别?

c - 处理来自 execvp() 的错误

java - 自动化设计模式 C++

flutter - 多个设备(android、ios 和 web)使用相同的 google clientId 和 clientSecret

bash - 如何重定向 '&' 命令的日志?

bash - 脚本,将所有 $input 保存到 1 个变量中

linux - 脚本:从远程计算机读取文件并存储在 dir 变量中

ios - 当提示输入远程主机的 SCP 密码时,如何将回车添加到 bash?

asp.net - 在没有 System.Web 的 ASP.NET 中获取 Windows 用户名