I am still confused how this will work when we factor in resources, I mean getfile should never return a string, it should return a resource. Are you sure there isn't other code that makes getFile return a string?