PHP ActiveX Requires Chilkat v11.0.0+
PHP ActiveX
Transition from Http.PFile to Http.HttpFile
Provides instructions for replacing deprecated PFile method calls with HttpFile.Chilkat PHP ActiveX Downloads
<?php
$success = 0;
$http = new COM("Chilkat.Http");
$verb = 'POST';
$url = 'https://example.com/';
$localFilePath = 'c:/temp/requestBodyContent.dat';
$contentType = 'application/octet-stream';
// ------------------------------------------------------------------------
// The PFile method is deprecated:
// responseObj is a Chilkat.HttpResponse
$responseObj = $http->PFile($verb,$url,$localFilePath,$contentType,0,0);
if ($http->LastMethodSuccess == 0) {
print $http->LastErrorText . "\n";
exit;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using HttpFile.
// Your application creates a new, empty HttpResponse object which is passed
// in the last argument and filled upon success.
$responseOut = new COM("Chilkat.HttpResponse");
$success = $http->HttpFile($verb,$url,$localFilePath,$contentType,$responseOut);
if ($success == 0) {
print $http->LastErrorText . "\n";
exit;
}
?>