curl command:
curl -X PUT -F "file=@./test.txt" -H "X-Object-Meta-One: two" -H "X-Object-Meta-Three: Four" http://localhost:8080/test.txt
result line 8:
curl_setopt($ch, CURLOPT_POSTFIELDS, 'file' => '@' .realpath('./test.txt'));
should be:
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' => '@' . realpath('./test.txt')));