How to make the pdf files downloadable? I am able to display file with url: For example

echo '&lt;a href="'.$file_url.'" target="_blank"&gt;'.$path_parts['basename'].'&lt;/a&gt;';


How can I make this file downloadable? In case of pdf files, it is not downloading and opening in new tab as i have added target.
If you want to Force download PDF files. 
if your server is Apache

put this line in your .htaccess file.

AddType application/octet-stream .pdf


If there is any issues with browser try this 

SetEnvIf Request_URI "\.pdf$" requested_pdf=pdf
Header add Content-Disposition "attachment" env=requested_pdf


If its NGINX

location ~* /orig/(.+\.jpg)$ {
    internal;
    add_header Content-disposition "attachment; filename=$1";
}