• Hi there!

    It seems it gives the wrong attachment file when downloading. It’s getting the current download directory instead of getting the actual attachment. So a month later, the file won’t download.

    I fixed it with this:

    //Getting the path to work with filesize()
    //$wp_upload_dir = wp_upload_dir();
    //$current_upload_dir = $wp_upload_dir['path'];
    //$filepath = $current_upload_dir.'/'.$file_name;
    
    // get real path of file
    $filepath = get_attached_file( (int) $_GET['edmc'] );

    Or this could work too:

    //Getting the path to work with filesize()
    $wp_upload_dir = wp_upload_dir();
    $current_upload_dir = $wp_upload_dir['basedir'];
    $filepath = $current_upload_dir.'/'.$file_name;

    Thanks!

    https://www.ads-software.com/extend/plugins/easy-download-media-counter/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Easy Download Media Counter] Download files are empty when you download them’ is closed to new replies.