<p dir="ltr"><br>
On Sep 4, 2013 1:29 PM, "Ferrous Cranus" <<a href="mailto:nikos@superhost.gr">nikos@superhost.gr</a>> wrote:<br>
><br>
> Python help.<br>
><br>
> I use the following code in a cgi file<br>
> to give the client a download link to<br>
> download a file.<br>
><br>
> ---<br>
><br>
> print "%s" % ('<a href = "Setup.zip"> Down<br>
> Load </a>')<br>
><br>
> ----<br>
><br>
> A click on "Down Load" opens a pop up browser<br>
> window which allows the user to choose where<br>
> to download the "Setup.zip" file, then after<br>
> the download, the pop up window closes.<br>
><br>
> My problem is that I want the cgi form, which<br>
> contains the link, to also close after the<br>
> download.  The only way I can figure out to<br>
> close the cgi window is to give the user a<br>
> button to close it.<br>
><br>
> Without closing it, the client can download<br>
> again and forever if they choose to because<br>
> the cgi window is open and the link is still<br>
> active.<br>
><br>
> I am trying to find a way to close the cgi<br>
> file or call another file after the download<br>
> without adding a close button and asking the<br>
> client to close the window.<br>
><br>
> jd<br>
><br>
></p>
<p dir="ltr">There is no such thing as a "cgi form" or "cgi window". Your cgi script runs when the user requests a Web page, generates a page, and then ends. At that point, python has stopped running. If your want the client's browser window to close, that's not a python problem. If you want to invalidate the download link after one successful download, you'll have to add a unique identifier to the url and keep track of which identifiers are still valid.<br>

</p>