make get_filepath_or_buffer work