$file only contains the filename and not the absolute path, that means that files in a subdirectory will not get properly resolved and an empty filesize is returned.

This feature only exists on master.
Merge pull request #12264 from owncloud/use-full-path-for-filesize-calculation

Use full path instead of only the filename