Accept file objects as input (as well as filepaths)