<p>This a bit of strange one.... We have an internal web app that runs on server (A) and a document repository that runs on server (B). </p>

<p>I have simple link on a page and I want to enable the user to download a document(From IIS Server (A)). However this document does not exist on Server (A) until the user clicks the button(because there is 40+ documents to display cannot load them all when the page loads)</p>

<p>When the user clicks the link(at which point I would like then to be prompted to download)
The  document is copied to server (A) and then redirected to a page where the browser prompts them to download. I believe I have set up the content header correctly and it works in FireFox. </p>

<p>IE(7) just pops up a window and then the window disappears, If I turn down the security settings it works OK but that is not an option. </p>

<p>Any Ideas how to solve this. I cannot point directly to the document on Server(B)</p>

<p>ADDITION: Yes Server B is also a Web Server </p>

Can you use ajax? For example, the user clicks the button sending a request to get the file from B to A and a spinner shows up on the page. Then when the copy is done, you disable the spinner and give the user a download link.
I was voted down and don't have comment privileges, so I figured I would elaborate here (perhaps this is just a terrible solution and I cannot see it):
User requests file by clicking link
Request is sent to server A and it disables the link via ajax
Server A copies the file to a temporary directory from server B
Server A sends back a link to the file in the temporary folder
This would work if the document server was not a webserver (SMB, AFS, NFS, etc).