Found the solution of this.
We need to convert file to binary and send it:
$sendBinaryFileContent = 'data:application/pdf;base64,'.base64_encode(file_get_contents($filePath));
Binary file handle:
$binaryFile = str_replace('data:application/pdf;base64,', '', $binaryFile);
$file = base64_decode($binaryFile);