Close browser popup after file upload

When the user clicks on the hyperlink, I open a popup that loads the file. After loading, it shows the open / save dialog box. I want to close the popup after the download is complete (when the user is prompted to save the file). I tried the window.close method, but it does not work, because the context is not a popup, but an open / save dialog.

+5
source share
4 answers

I think you cannot control it programmatically. This is a browser-specific thing, when some browsers allow you to check the box to close the window, etc.

+5
source

you can do one thing:

, " struts"

1: "response.flushBuffer();" 2: response.sendRedirect( "close.htm" )

close.htm:

<html>


<script>


window.close();

</script>

</html>

. , . , . . JavaScript, ?

 pop_up= window.open("", "PopUpName");   
 pop_up.document.write('POPUP TEXT');      
 pop_up.close(); 
+2

, , , . , , , , . , .

, Content-Type application/force-download. , , ( ) PHP .Net( ). , target="_blank", .

+1

, . . firefox, , crome . .

0

All Articles