cURL / Mailing Lists / curl-users / Single Mail

curl-users

Curl won't read from stdin for --upload-file

From: Paul M De Goes <pauldegoes_at_hotmail.com>
Date: Wed, 18 Nov 2009 17:58:11 -0700

Hey there,

I'm a recent cUrl user and am testing its functions against my own test site. The following code produces the expected PUT method and the contents of file File.txt:

curl --upload-file C:\\File\\File.txt http://www.mySite.com/index.php

When I try to send data through stdin like this, however:

echo "C:\\File\\File.txt" | curl --upload-file - http://www.mySite.com/index.php

I get a correct PUT method with no data. I've also tried:

curl --upload-file - http://www.stjohnhome.us/index.php < C:\\File\\File.txt

as an alternative, just in case cUrl was looking for a file. I thought the "-" symbol following --upload-file indicated that curl would read out from the stdin. Can anyone clarify for me?

~Paul D

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-11-19