add a fileinput helper function