Title: Download Headers Problem
Last modified: June 4, 2020

---

# Download Headers Problem

 *  Resolved [aurepons](https://wordpress.org/support/users/aurepons/)
 * (@aurepons)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/download-headers-problem/)
 * Hi, my problem is that all downloads are forced to be attachments, where I need
   inline downloads to open PDF directly in browser.
 * You force it including the download http headers by code:
 *     ```
       header( 'Content-Type: application/octet-stream' );
       header( 'Content-Disposition: attachment; filename=' . $filename );
       ```
   
 * 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:
 * `do_action( 'lana_downloads_manager_after_download_http_headers', $download_id);`
 * Thank you very much

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Lana Codes](https://wordpress.org/support/users/lanacodes/)
 * (@lanacodes)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/download-headers-problem/#post-12940112)
 * Yeah, this has been a topic here on the forum several times.
 * Please read this: [https://wordpress.org/support/topic/open-pdf-in-new-window-not-download/](https://wordpress.org/support/topic/open-pdf-in-new-window-not-download/)
 * But otherwise there is an action hook:
    `do_action( 'lana_downloads_manager_before_file_download',
   $download_id );`
 * You check that the file is a PDF and if so, you open it.
 * You need to add the header() functions again, but I think it will work. It is
   not customary to add hooks to all rows, we only add them at the beginning of 
   the process, and completely redefine individual operation.
 * Let me know if I can help anyone else.
 *  Thread Starter [aurepons](https://wordpress.org/support/users/aurepons/)
 * (@aurepons)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/download-headers-problem/#post-12945059)
 * Thank you very much, I have solved it as you indicate
    -  This reply was modified 6 years, 4 months ago by [aurepons](https://wordpress.org/support/users/aurepons/).

Viewing 2 replies - 1 through 2 (of 2 total)

 The topic ‘Download Headers Problem’ is closed to new replies.

 * ![](https://ps.w.org/lana-downloads-manager/assets/icon-128x128.jpg?rev=1512693)
 * [Lana Downloads Manager](https://wordpress.org/plugins/lana-downloads-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lana-downloads-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lana-downloads-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/lana-downloads-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lana-downloads-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lana-downloads-manager/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [aurepons](https://wordpress.org/support/users/aurepons/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/download-headers-problem/#post-12945059)
 * Status: resolved