I'm reading a PDF file content using php fread function. Now I want to post this data through JSON object. So, how can I send this data(content of PDF file)?
I'm using POSTMAN to send pdf file by selecting binary in header option and getting desired result. But how can I achieve this programatically using PHP.
$readfile = fopen("newfile.pdf", "r") or die("Unable to open file!");
echo fread($readfile,filesize("newfile.pdf"));
fclose($readfile);
Using this fread method I'm getting content of 'newfile.pdf'.
I want to send content of 'newfile.pdf' as a JSON object without base64 encode or decode.