Reputation: 1332
I am trying to post a large XML file to a web address by using curl in a shell script. I am posting the data using the '-F' option in curl. Whenever I post a file larger than 1024 bytes, the file gets cut off and only sends the first 1024. I've tried changing the "Expect:" header as suggested in another solution for PHP Curl, but it does not work.
Here is the command line I am using:
curl -F "xml=</fileoutput.xml" http://servername/page.html
As I said earlier, I've tried both -H "Expect:" -H "Expect: 100-continue"
Neither work. Please help!
Upvotes: 1
Views: 3939
Reputation: 13421
According to the man page the -F option does do POST so it doesn't look like it's a GET issue. The man page also says to prefix the file with an @ to use the file as the content so perhaps the command should be
curl -F xml=@some_file http://servername/page.html
Upvotes: 4
Reputation: 37065
In order to poast a file you have to use the @
in front of the URL. I think Troubadour already mentions this, but it needs to be in quotes like:
curl -F "xml=@http://servername/page.xml"
Also notice That I changed it to .xml
as you said you were trying to post a large XML file, not a large HTML file.
Upvotes: 4
Reputation: 11213
I think you need to use -d instead of -f ?
-d seems to post the data. As Sab pointed out GET has a very small maximum size, you must post the file and to do this you must use -d rather than -f.
Upvotes: 0
Reputation: 2903
Is it possible that the web address itself has this limitation? Have you tried posting the same file manually via a web browser?
Upvotes: 1