This cloud experience is better than I thought. The sun is shining. Right, now back to work '; $request = array( "accessKey" => $accessKey, "templateName" => "$templateName", "outputName" => "$outputName", "data" => "$data" ); $requestHeaders = array('Content-Type' => 'multipart/form-data'); $ch = curl_init('https://dws2.docmosis.com/services/rs/render'); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $responseData = curl_exec($ch); if ( $responseData != false) { $headers = curl_getinfo($ch); curl_close($ch); if ($headers['http_code'] == '200') { // success!! // write the file out (since we didn't say where to send the // result, Docmosis sent us the result) $tempDirName = "."; $tempFileName = realpath($tempDirName) . "/" . $outputName; $renderedFile = file_put_contents($tempFileName, $responseData); echo "File saved to $tempFileName\n"; } else { // failed - check error and result message echo "Failed:" . $responseData . "\n"; } } else { echo "curlexec failed.\n\nDocmosis Cloud must be used via HTTPS.\n\nCheck your CA certificates, or try un-commenting CURLOPT_SSL_VERIFYPEER line (for troubleshooting only)"; } ?>