I am facing the same problem too. Any solution to this?
And also when I try to retrieve ctx.vars.file.@md5 or ctx.vars.file.@originalName both return blank value. The record is stored inside the xtk:fileRes schema after I run the script but with blank value for both Original Name and md5 key. And the record appears under public resources but no file uploaded inside.