I have never done any curling before so need some help. I tried to solve this problem from examples but can't understand it!
I have a curl command that I can successfully run from the linux (ubuntu) command line to put files into the wiki via the api.
I need to incorporate this curl command into a PHP script I'm building.
How do I translate this curl command so that it works in a PHP script?
curl -b cookie.txt -X PUT --data-binary "@test.png" -H "Content-Type: image/png" "http://hostname/@api/deki/pages/=TestPage/files/=test.png" -0
The cookie.txt contains the authentication, but I have no problem putting it in clear text into the script since this is only run by me.
@test.png must be a variable, such as $filename
http://hostname/@api/deck/pages/=TestPage/files/= must be a variable, such as $pageurl
Thanks for your help.
you need to...
curl-to-PHP:https://incarnate.github.io/curl-to-php/
"Instantly convert curl commands to PHP code"
starting point:
See also:http://www.php.net/manual /en/function.curl-setopt.php