Added option to use temp file if file >100mb