Support » Plugin: WP Publication Archive » [Plugin: WP Publication Archive] File not downloading- Blank page is opened.

  • Resolved kelsiek


    Hello, I’ve been trying to use this plugin to manage downloadable newsletters and printable calendars for a church website (All PDF files).

    I installed the plugin and it appears to be working (archives are generated correctly); however, when I click the ‘download’ link for any of my test documents I am simply presented with a blank page- no download occurs.

    Am I uploading the documents incorrectly?
    Or have I messed up something else that this plugin relies on? (I’m very new to WordPress as a CMS. This is my first project so yes, it’s ugly.)

    Any help is much appreciated!

    Page where archives appear:

    (None of the files linked here work. They’re all just test files.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Eric Mann


    There is likely something wrong with the way your server is set up.

    The plugin itself uses a file (openfile.php) to load the publications as attachments so they’ll download. To prevent people from using this file improperly (i.e. using your site to download/stream remote content), there’s a check at the top of the file to make sure the requested document is being served from your system.

    It looks like the fact that you’re using a “www” at the beginning of your domain is what’s breaking things. I can successfully download the files if I remove it. So here are two things you can do to fix the problem:

    1) The easy way
    After you upload a file, you’ll see the URL in the “Publication” field. Simply remove the www from the address.

    So becomes

    Change that, and it will work.

    2) The hard way
    Edit /includes/openfile.php and remove these two lines:

    if ( strpos( $_GET['file'], (isset($_SERVER['HTTPS']) ? 'https|' : 'http|') . $_SERVER['SERVER_NAME'] ) === false )

    They should be lines 5 and 6 of the file. This is a more permanent fix, but it will open you up to the possibility that your site is used to download/stream remote files … so I recommend using the easy way (#1) for now and I’ll try to work a more permanent fix into the next version.

    Thanks, the easy fix worked perfectly.

    I want to make the maintenance of this website as simple as possible for the pastor- so as soon as a permanent fix is found I will be sure to implement it.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP Publication Archive] File not downloading- Blank page is opened.’ is closed to new replies.