I have a source URL that displays the pdf document in the browser. It supposes to download automatically.
Sample URL : http://doc.local.com/storage/temporary/2020-02-19/c3e175b4706492be8c0d90e497c86ea7/test.pdf
Exactly I want to implement how amazon s3 temporary url works (they added all the headers in the url)
response-content-disposition=attachment
Please don't suggest me to use the following code, as front-end expect an URL
header("Content-Length: " . filesize($file));
header("Content-Type: application/octet-stream;");
readfile($file);