solved File MD5 checksum for integrity check on downloads

amartins
@amartins
8 years ago
48 posts
Hello Jamroom Proxima staff! I'm glad you developed it!
I have a question regarding to files integrity/update check using MD5 hash.
But first I'd like to ask you if you already have a way to check downloaded files integrity, have you? If so, please let me know.

What I'd like to have is MD5 hahs files added into items data. For instance, let's say I search audio module for an audio file, and I want to download it, using Proxima Bridge - in the items list if I have the MD5 hash of corresponding file (audio or image) on Jamroom platform, i can easily get the MD5 of the downloaded file and compare with remote one to check if the download was really successful or not. Do you think we can have something like this?
Just wondering... Because If I want to sale audio files over app I have to ensure that user has a valid file for which he/she paid for.
Thanks for attention.
updated by @amartins: 08/09/16 10:35:59PM
brian
@brian
8 years ago
10,144 posts
To do this would require a small custom module with a "save_media_file" event listener that would do an md5_file() on the uploaded file - i.e.
function xxCustom_save_media_file_listener($_data, $_user, $_conf, $_args, $event)
{ $_data["{$_args['file_name']}_md5"] = md5_file($_args['saved_file']); return $_data; }
Easier would be to just use the existing file size - while it's not as 100% foolproof as MD5, it's already support and should be find 99.9% of the time.

Let me know if that helps.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
amartins
@amartins
8 years ago
48 posts
Thanks Brian, this helps.
brian
@brian
8 years ago
10,144 posts
amartins:
Thanks Brian, this helps.

No problem!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

Tags