Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Curl for Windows - curl couldn't open file C:\test.txt

Tags:

path

curl

windows

I am trying to use CURL on a Windows device and cannot work out the correct syntax for uploading a file in a specific location, was hoping someone may have an idea.

At the moment the syntax I am trying is below;

curl --proxy-ntlm --proxy-user domain\username:password --proxy proxy.server:80 -vk 'filename=hello.txt' -F 'file=@C:\hello.txt' https://upload.site

But all I am getting back is curl: (26) couldn't open file "C:\hello.txt"

I have tried @C:\\hello.txt, @C:/hello.txt, @"C:\hello.txt" but still getting the same error.

Does anyone have any ideas where I maybe going wrong? I can't believe it should be as hard as I am making this out to be :-)

like image 613
StevieHyperB Avatar asked Oct 20 '25 01:10

StevieHyperB


1 Answers

On Window 7, i got same issue. i just fix ' to "

For example:

curl --proxy-ntlm --proxy-user domain\username:password --proxy proxy.server:80 -vk "filename=hello.txt" -F "file=@C:\hello.txt" https://upload.site
like image 82
정서로 Avatar answered Oct 22 '25 03:10

정서로