本文介绍了如何使用响应头文件名与cURL保存文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这个问题与cURL的命令行版本有关。
This question relates to the command line version of cURL.
我试图从cgi脚本下载一个文件。
I'm trying to download a file from a cgi script.
使用浏览器的文件名为'remotefilename.gz'
cURL想将文件保存为'dl.pl?ID=2 '
Using a browser the filename comes up as 'remotefilename.gz'cURL wants to save the file as 'dl.pl?ID=2'
如何获取cURL保存到响应头文件名的文件
How do I get cURL to save to a file with the filename from the response header??
推荐答案
if you have a new enough curl (version 7.20.0 or later), -J/--remote-header-name is what you want.
这篇关于如何使用响应头文件名与cURL保存文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!