I had a diffculty in dong it also thought so that i will post my solution here, it goes ...
this curl command sends the file to the url and sends back whatever data it receives. It sends an xml file, so the content type is set to application / x-www-form-urlencoded. Api, I sent a request for the data to be encoded, so I use --data-urlencode. I also assign a file name with the variable name to the post here, so it seems to send an input field with name = "whatever."
curl --data-urlencode [post variable name] =@ [filename] --header "Content-Type:application/x-www-form-urlencoded" http://[url to send file to]
Assigning a command to a variable is easy ... see below
content=$(put curl command in here);
P. DO NOT FORGET TO CHOOSE ANY '=' or '&' in your URL, this causes problems if you try to get the data.
source share