Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use curl to http post a file to a url like:

curl -d myfile.xml http://www.example.dom/post/file/here

Can I set the parameter I want the file to be posted with? Like if it was a querystring I would do: ?file=filedatahere

How do you do that with a post?

share|improve this question

Yes you can specify parameters via querystring to a resource you are posting to. Also you should use '@' before a filename if the data is being read from a file. So using your example I believe this should look like:

curl -d @myfile.xml "http://www.example.dom/post/file/here?foo=bar&this=that"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.