allow file to be passed as a string