WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
Print crc-32/MD5/SHA-1 in custom template (7 posts)

  1. itaushanov
    Member
    Posted 8 months ago #

    How do I print crc-32/MD5/SHA-1 for the file in question in the custom template content-download-custom.php ?

    My goal is to get the template to print:

    filename.ext (filesize;donload_count)
    MD5: xxxxxx
    CRC-32: xxxxxxxxxxxx
    SHA-1: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    Can't quite figure out how to get the file location and use it in md5_file($file_location).

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

  2. itaushanov
    Member
    Posted 8 months ago #

    $filename = $dlm_download->get_file_version()->url; $filemd5 = md5_file($filename); echo $filemd5;

    Hmm, this seems to work if "deny from all" is removed from .htaccess in dlm_uploads directory where the file is, which shouldn't be done afaik.

    What would be a proper way to do this task?

  3. itaushanov
    Member
    Posted 8 months ago #

    Shameless bump

  4. mdmower
    Member
    Posted 7 months ago #

    This isn't the answer you want to hear, but I do not suggest including this information in the template. The problem is these hashes will be calculated every time a user loads the page. If you have some large-ish files, this is very cpu intensive for a simple web page. The better option would be for the developer to include an option to calculate the file hashes when they're added to Download Monitor and incorporate a code like $dlm_download->get_the_md5_hash().

  5. itaushanov
    Member
    Posted 7 months ago #

    That would be a great addition to the plugin itself. Thanks for your input.

    Now I can only hope the author reads this and have the time and willingness to implement it.

  6. Zyniker
    Member
    Posted 7 months ago #

    If you want the author to notice this recommendation, you would probably do better to contact him via GitHub or his website than via these forums.

  7. itaushanov
    Member
    Posted 7 months ago #

    Will try that, thanks.

    The request at GitHub:
    https://github.com/mikejolley/download-monitor/issues/104

Reply

You must log in to post.

About this Plugin

About this Topic