Back to forum list… Back to How Do I?...

Looking to create a function using MD5 as an iMan function? (1 reply)

Lisa Lowery
5 years ago
Lisa Lowery 5 years ago

We have a process where we grab a PDF file from ftp but we need to verify the file is viable and complete. We were able to successfully create this ‘check’ in visual studio and hoping to use this or something similar as a function in IMan. We hard-coded the filepath here but this would be a parameter. Basically we are comparing the MD5 extracted to the MD5 stored in the file name.

The file name is:

C:/temp/13759007064.md58052856ACE07622625330F7F77FC1777.pdf

Support
5 years ago
Support 5 years ago

Lisa, our recommended approach would be to create a Common Function to calculate the MD5 hash of a given file, then you could compare the result of the function the file path.

Function CompareMD5Hash(sFilePath)

Dim MD5
Dim bContents
Dim inStream

Set inStream = CreateObject("ADODB.Stream")
inStream.Open
inStream.Type = 1
inStream.LoadFromFile CStr(sFilePath)
bContents = inStream.Read

Set MD5 = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider")

MD5.Initialize
bContents = MD5.ComputeHash_2((bContents))

CompareMD5Hash = Base64EncodeBinary(bContents)

End Function

Contact

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Request Demo

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close

Access Downloads

Realisable Software Ltd provides code-free, cost-effective applications integration solutions for SMEs. Our core IMan product is designed to integrate almost any application with a number of Sage solutions and online payment processors.

Looking to purchase IMan, please see our resellers here.

Realisable Software
Ph: +44 (0) 208 123 1017

Copyright © Realisable. All rights reserved.
Realisable is a registered trademark

Close