WordPress.org

Ready to get started?Download WordPress

Forums

WP Publication Archive
[resolved] Download files empty on IIS (4 posts)

  1. Naturalrush
    Member
    Posted 2 years ago #

    Eric, thanks again for the plugin but I'm encountering some issues in getting it implemented.

    This was working fine on a WP site using a WAMP setup. I then moved it to a production server WIMP running IIS 6 (stuck with that setup) and the document downloads result in empty files. No errors are being thrown. It appears to download fine except it is a 0kb file with nothing in it.

    I can upload documents/publications just fine.

    I can also go to the built-in WP media library, see the PDF (in this case), click View and the attachment ID link to get it. My guess is it is someting to do with the openfile.php in a Windows environment.

    I'll see if I can figure something out but wanted to go ahead and put this issue on here.

    Thanks,
    -Ray

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

  2. Naturalrush
    Member
    Posted 2 years ago #

    Follow up.

    Error logging some output values, the path and filename look good.

    The URI passed in on the $fPath var in openfile.php is valid, and logged into the site I can put that URI in the brower address and download the file. Path is valid. PHP can read and write it since it was uploaded in the first place.

    I even tried commenting out the output buffering and using straight cURL with the same results.

    Sigh

  3. Eric Mann
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for pointing this out. Unfortunately, I don't have an IIS setup I can test it in so I can't reproduce this locally. If you find anything out, though, please let me know and I'll see what I can do to patch it.

  4. Naturalrush
    Member
    Posted 2 years ago #

    This is an unusually quiet Friday night. So, with this gnawing at me I decided to look at it again. Good grief, I don't know how I missed it. The URL isn't valid. It is missing a slash so it's http:/www.server.com instead of http://. Argh! Using an HTTP inspector it's passing it fine. In fact, I was surprised to see it wasn't properly url encoded. It appears this is an area where not all web servers behave the same. Apache allowed it but IIS 6 botched it without error.

    One possible fix is line 92 of lib/class.publication-markup.php, the $uri var can be wrapped in urlencode(), so
    return $downloadroot . urlencode($uri)

    -Ray

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic