Good point.
You could return the post data right away instead of saving it in a file if it were a single request, but as there are two requests to the server, you have to persist the data on the server upon first request and return it as a file in the second request.
Though it's not necessary to store the post data in a file, you could store the post data in a session. As a matter of fact, saving post data in session seems better solution in terms of concurrency and security.