I've never done any curl before so am in need of some help. I've tried to work this out from examples but cannot get my head around it!
I have a curl command that I can successfully run from a linux(ubuntu) command line that puts a file to a wiki through an api.
I would need to incorporate this curl command in a PHP script I'm building.
How can 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
cookie.txt contains the authentication but I don't have a problem putting this in clear text in the script as this will be run by me only.
@test.png must be a variable such as $filename
http://hostname/@api/deki/pages/=TestPage/files/= must be a variable such as $pageurl
Thanks for any help.