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

  1. itaushanov
    Posted 2 years 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).


  2. itaushanov
    Posted 2 years 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
    Posted 2 years ago #

    Shameless bump

  4. mdmower
    Posted 2 years 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
    Posted 2 years 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
    Posted 2 years 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
    Posted 2 years ago #

    Will try that, thanks.

    The request at GitHub:

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Download Monitor
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic