I'm trying to call ConvertAPI.com/Word2Pdf, but with no success.
My sample code is:
$fileToConvert = 'test.docx';
$apiKey = *******;
$postdata = array('OutputFileName' => 'test.pdf', 'ApiKey' => $apiKey, 'File' => $fileToConvert);
$ch = curl_init("http://do.convertapi.com/Word2Pdf");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
$result = curl_exec($ch);
$headers = curl_getinfo($ch);
curl_close($ch);
var_dump($result);
I'm getting as a result something like: "HTTP/1.1 100 Continue HTTP/1.1 400 The 'File' parameter cannot be null. Please set value. Cache-Control: no-cache, no-store Pragma: no-cache Content-Type: text/html..."
What I'm doing wrong here?