'In Chrome, files cannot be downloaded if previous pop up window is not closed

In .aspx file:

<a href='#' onclick='download(\"" + fileID + "\");return false;'>Download</a>

In .aspx.vb file:

function downloadFile(inFileID) {
     window.open('../DownloadFile.ashx?id=' + fileID, 'file', 'width=600,height=800').focus()
}

In .ashx.vb file:

context.Response.AddHeader("content-disposition", String.Format("attachment;filename={0}", fileName))
context.Response.BinaryWrite(fileContent)

The downloaded file is shown at bottom of Chrome.

The situation: If the pop up window is not closed manually and then I click to download file again (no matter the same or different file), the code executed successfully without error but no file will be downloaded.

It is okay to download again if the pop up window is closed first.

How can I successfully download file again even the pop up window is not closed?

I planned to close pop up window through coding. However, the downloaded file list is shown at the bottom of pop up window. If it is closed, then I cannot view the files directly



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source