send fax using curl

Hi, I am trying to send fax using curl. I can send it via my localhost. But when I am uploading code to server and try to send it with attachment it is showing some error like:
[errorCode] => MSG-356
[message] => Either filename or content type should be specified, attachment [1]: []
[attachmentFileName] =>
[attachmentNumber] => 1.

$response = curl_exec($ch);
curl_close($ch);
$data = (json_decode($response));
echo '<pre>';
print_r($data); exit;
/////////////////////////////////////////////////////////////////////////////////////////////
It is working perfect on my local server. But when I upload it to server,
I am getting this error:-

First of all, is there any reason you don't want to use our SDKs? Using our SDKs is the most convenient way to access RingCentral platform and call the APIs. What programming language do you use? https://github.com/ringcentral

$response = curl_exec($ch);
curl_close($ch);
$data = (json_decode($response));
echo '<pre>';
print_r($data); exit;
/////////////////////////////////////////////////////////////////////////////////////////////
It is working perfect on my local server. But when I upload it to server,
I am getting this error:-

First of all, what issue did you face when you use the RingCentral SDK to get authentication? If your app is password flow, check out this tutorial

Secondly, if your code works well on localhost, your code to call RingCentral fax endpoint must be correct. Now, if it does not work on your remote server and the complaint is about the attachment, the problem is most likely with your file on the server or as you said, some "permission" issue setting for your server that I cannot be aware of.

This is not a RingCentral API problem but I guess our server cannot reach the attachment file with the specified path realpath('/var/www/html/pdf2-199167_doc.pdf'). Can you put the file somewhere that it could be accessible e.g. from the browser and use that link.

Its done sir. Every thing was correct. I did it through ringcentral lite.
Now I have another problem. I have records of inbound and outbound fax in my project. I am getting the records but if I want do download any record I is not working.
Please suggest me how to download it.