This is a short guide on how to force a PDF file to download using PHP. to your PDF file. $pdfFile = 'adopteesofcolor.org'; //Set the Content-Type to application/pdf. Force browser to download file instead of displaying (pdf, doc, docx, odt etc) -. php. case "pdf": header("Content-type: application/pdf");. Content-Type: application/pdf; Content-Disposition: inline; or you can install a plugin to force view, an example for Chrome: Docs PDF/PowerPoint Viewer (by. I've noticed that, with iOS and Android, if I click a link to a pdf on a web page, the file header('Content-Type: application/force-download');. Solved: When adding a PDF as attachment to a page, the content type of the attachment is usually set to application/pdf. However, sometimes it is. Use PHP and the content-disposition HTTP header to force files to download that would normally header("Content-type: application/pdf");. To indicate to the browser that the file should be viewed in the browser: Content- Type: application/pdf Content-Disposition: inline; filename="adopteesofcolor.org". The file type can be specified by the server with a Content-Type header. I've seen application/force-download used - which ends up as a. I'm trying to force the download of an adobe pdf file, and I don't want to If this header is used in a response with the application/octet- stream content-type, the . The “Content-type” response Header generated and sent by the server. To force inline viewing of PDF files, edit the website's HTTP and.