Feature #4977: Support temporary file downloading and rename if succeed