• hello,

    my file sizes are not showing up? is this a bug, or im doing something wrong?

    Adding {size} to custom output or directly to tag [download#1#size] does not work.

    any idea how to fix it?

    thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Mike

    (@jolley_small)

    Not all servers support it and it only works with files on your own server (not external).

    Thread Starter solefald

    (@solefald)

    yes, this is on my own server.
    it’s running Debian linux with apache2, mysql5 and php5.

    most common setup, really.

    is it supposed to work for me or not?

    Thread Starter solefald

    (@solefald)

    ok, i fixed it, by hardcoding my info into wp-download_monitor.php

    line 754 has flawed logic

    $path = str_replace(get_bloginfo('wpurl'),"./",$path);

    my wpurl is “http://www.domain.com/blog/”, so basically your code completely strips that, and makes $path

    .//wp-content/uploads/file.blah

    which, obviously, does not work.
    my fix was to replace “./” with “blog”

    $path = str_replace(get_bloginfo('wpurl'),"blog",$path);

    but this only works for files located in $wpurl/wp-content/uploads”

    got to figure out how to make it work on existing files, located in other dirs….

    Mike

    (@jolley_small)

    Yes it must be. I think it works fine when you upload via the interface to wp-content/uploads. The reason being it needs a relative url; not an absolute url to the file.

    Maybe I can find a better way of calculating the relative url.

    w.r.t: Plugin version 3.1.5

    Aaargh …. same issue here on my site! The flaw is in the logic of creating the final path in wp_dlm_get_size() function in line 903.

    The current logic fails when wordpress core (wp-content folder) files are in a subdirectory of the blog directory.

    Had to hardcode as of now.
    $path = str_replace(get_bloginfo('wpurl'),"./mysubdirectory",$path);

    I modified it to replace the URL path with the file path. Works for me.

    $path = str_replace(get_option('upload_url_path'), get_option('upload_path') ,$path);

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WordPress Download Monitor] Size not working?’ is closed to new replies.