I am using this javascript function to launch download
function startDownload(url) {
window.open(url, 'Download');
}
It works, but i want to block any new tab or new window launch, thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This will start the download in the same page, exactly like when you click a link without any target other than
_self.To force the download of a file, make sure you send the right headers with it:
This will make sure that the file is not displayed in the browser instead of being downloaded. Replace the filename part with the filename you want as default on the
save asdialog.