The file is downloaded at runtime with a random string of characters. The temp file uses a separate string that is entirely unrelated to the original file.
The only solution I can think would be to record the time, start the download, if the file is a .tmp then grab the top file in downloads folder (filtered after the start time) and hope you only have one file in there that is correct.