WordPress.org

Ready to get started?Download WordPress

Forums

WP Publication Archive
[resolved] File not downloading- Blank page is opened. (3 posts)

  1. kelsiek
    Member
    Posted 2 years ago #

    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: http://www.trinityboyceville.com/resources/archives/

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

    http://wordpress.org/extend/plugins/wp-publication-archive/

  2. Eric Mann
    Member
    Plugin Author

    Posted 2 years ago #

    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 http://www.trinityboyceville.com/wp-content/uploads/2012/01/Test-PDF.pdf becomes http://trinityboyceville.com/wp-content/uploads/2012/01/Test-PDF.pdf

    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 )
    	die();

    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.

  3. kelsiek
    Member
    Posted 2 years ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic