Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| apFilePath | String | Yes | File path |
| digestAlgorithm | String | No | Hash algorithm: md5 or sha1, md5 by default |
| success | Function | No | Callback with file info |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Success Callback
| Property | Type | Description |
|---|---|---|
| size | Number | File size in bytes |
| digest | String | File hash digest |
Code Example
my.getFileInfo({
apFilePath: filePath,
digestAlgorithm: 'md5',
success: (res) => {
console.log('Size:', res.size);
console.log('MD5:', res.digest);
}
});