![Picture of Meitar Picture of Meitar](/graphics/unknown.gif)
Meitar - 2016-01-23 06:46:39
Hi,
As a follow up to my last post (http://www.phpclasses.org/discuss/package/7700/thread/329/) I have noticed that the last parameter to CallAPI(), which is supposed to be the response of the request, is missing when trying to upload files.
This seems to happen because of lines 1684 and 1685 which check for an error from the HTTP client library:
---- BEGIN CODE SNIPPET ----
if(strlen($error = $http->SendRequest($arguments))
|| strlen($error = $http->ReadReplyHeaders($headers)))
{
$http->Close();
return($this->SetError('it was not possible to retrieve the '.$options['Resource'].': '.$error));
}
---- END CODE SNIPPET ----
If the user doesn't set a "custom" file name when uploading files, then the above part of SendAPIRequest(), returns prematurely, setting an error. However, the docs indicate that a custom file name is not required, so I don't think this should be an error.
Unfortunately, setting a custom file name ALSO doesn't work because then the GetFileDefinition() method inside the HTTP client library gives a different error: "it was not possible to access the file …".
The result is that, when uploading files, it is impossible to read the API call's result.