Windows 版 Curl -curl 无法打开文件 C:\test.txt

Ste*_*erB 4 windows curl path

我正在尝试在 Windows 设备上使用 CURL,但无法计算出在特定位置上传文件的正确语法,希望有人有一个想法。

目前我正在尝试的语法如下;

curl --proxy-ntlm --proxy-user domain\username:password --proxy proxy.server:80 -vk 'filename=hello.txt' -F 'file=@C:\hello.txt' https://upload.site
Run Code Online (Sandbox Code Playgroud)

但我所能得到的只是curl: (26) couldn't open file "C:\hello.txt"

我已经尝试过 @C:\\hello.txt、@C:/hello.txt、@"C:\hello.txt" 但仍然遇到相同的错误。

有人知道我可能出错的地方吗?我不敢相信这会像我想象的那么难:-)

小智 5

在 Window 7 上,我遇到了同样的问题。我只是将 ' 修复为 "

例如:

curl --proxy-ntlm --proxy-user domain\username:password --proxy proxy.server:80 -vk "filename=hello.txt" -F "file=@C:\hello.txt" https://upload.site
Run Code Online (Sandbox Code Playgroud)