Support » Plugin: Download Monitor » Zero 0kb file downloads and no permissions on new uploads

  • Resolved lukescammell

    (@lukescammell)


    Hi,

    Thank you for writing this plugin, it’s been great until something changed a few weeks back. I’m not sure what, it could be related to the shared hosting, I’m really not sure. This happened on 1.7, but updating to 1.8 hasn’t resolved it.

    When downloading a file it downloads saves a 0kb file with the correct filename. If the file was uploaded via FTP and I go to the file URL directly, it downloads just fine.

    Example

    Downloads, but saves the file as 0kb (no data).
    http://oastquilters.co.uk/download/1078/

    Displays directly in Chrome and can then be saved.
    http://oastquilters.co.uk/wp-content/downloads/oast-post/Vol16-No-3.pdf

    I’ve partially solved another issues where the /wp-content/uploads/dlm_uploads directory has a .htaccess file in it containing “deny from all” which was preventing direct downloads even. Files in this location (with or without the .htaccess in place) also download as 0kb files when downloading via a logged URL.

    All assistance greatly received. WordPress and all plugins are all completely up-to-date.

    https://wordpress.org/plugins/download-monitor/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Your headers suggest you’re using Apache with PHP 5.6. Could you check your apache error log right after attempting to download the file?

    Run as superuser (sudo or su, depending on your hosting environment)
    tail /var/log/apache2/error.log

    Also, to clarify, is Vol16-No-3.pdf the only file in download number 1078?

    I have had the same problem (0kb files) since about v 1.3ish and have had to apply the fix below after every update.

    https://wordpress.org/support/topic/downloading-0-bytes-on-v132?replies=9#post-4899086

    The line to change is now
    @ob_end_clean(); // Clear the output buffer
    replace with
    while ( ob_get_level() > 0 ) @ob_end_clean();
    YMMV but this fixes that specific issue for me every time..

    Thread Starter lukescammell

    (@lukescammell)

    Thanks james_so, that worked immediately, thank you!

    I’m not sure what this change does, but it would be nice if the author of the plugin could comment on this change as to why it might not be a good idea or why it couldn’t be implemented into the main plugin.

    mdmower, this site is on 1and1 shared hosting, so I’m not sure how I can get to the httpd logs.

    PHP 5.6.10

    To clarify, yes Vol16-No-3.pdf the only file in download number 1078.

    Thanks both of you.

    Plugin Contributor Barry Kooij

    (@barrykooij)

    Thanks for reporting this and James thanks for that code. I’ll look into this and will apply this fix to the plugin if tested ok.

    Thread Starter lukescammell

    (@lukescammell)

    Brilliant news Barry. Look forward to a fix 🙂

    Also, thank you for the excellent plugin, appreciate all you work on it. I’ll be sure to add a nice review as soon as that fix drops 😉

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Zero 0kb file downloads and no permissions on new uploads’ is closed to new replies.