flush out temporary file technique to avoid size limitation and potential complications