Compare local file with uploaded file

I’m currently working on putting in a check to make sure the uploaded video has the same file size as the source video. I’ve been looking in the API documentation and can’t seem to find a “filesize” function using media:get.

Am I just looking in the wrong spot?


and then

Thanks ofec1.

Are you suggesting I do a boolean check if (isOriginal)?

Hi Josh,

The KalturaFlavorAsset has a member called size, you can check the $flavor_asset->size for the flavour asset that has the isOrginal set to 1.

However, I wouldn’t recommend that. Checking sizes really does not ensure that the file was correctly uploaded, two files can have the exact same size and be different. This is why checksums are typically used. Unfortunately, we do not keep a checksum on the assetFlavor object.

However, just checking size IMHO is not useful. That said, if an entry managed to become ready [status == 2] it is likely that no data corruption occurred.

Once again thanks for the advice Jess.

I’ll go that route and see what my supervisors think.

When dealing with very small files, you can download the file of the original flavour from the Kaltura server and compare its checksum with the original but for big files, that strategy would not be overly recommended since the download will take time.