fix #19 by extracting the file from an object through tempfile