{"id":12940048,"date":"2020-06-04T18:40:01","date_gmt":"2020-06-04T18:40:01","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/download-headers-problem\/"},"modified":"2020-06-04T18:40:01","modified_gmt":"2020-06-04T18:40:01","slug":"download-headers-problem","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/download-headers-problem\/","title":{"rendered":"Download Headers Problem"},"content":{"rendered":"<p>Hi, my problem is that all downloads are forced to be attachments, where I need inline downloads to open PDF directly in browser.<\/p>\n<p>You force it including the download http headers by code:<\/p>\n<pre><code>header( &#039;Content-Type: application\/octet-stream&#039; );\nheader( &#039;Content-Disposition: attachment; filename=&#039; . $filename );<\/code><\/pre>\n<p>Is it possible for you to add a do_action hook beetwen header commands and readfile command? So I could change headers as I need. Something like this:<\/p>\n<p><code>do_action( &#039;lana_downloads_manager_after_download_http_headers&#039;, $download_id );<\/code><\/p>\n<p>Thank you very much<\/p>\n","protected":false},"template":"","class_list":["post-12940048","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12940048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/12940048\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=12940048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}