document.addEventListener('DOMContentLoaded', function() { var downloadButton = document.getElementById('downloadButton'); if (downloadButton) { downloadButton.addEventListener('click', function() { // File URL var fileUrl = 'http://dineshsomani.com/wp-content/uploads/2024/11/Investor-Complaint.xls'; // Check if file URL is accessible var xhr = new XMLHttpRequest(); xhr.open('HEAD', fileUrl, true); xhr.onreadystatechange = function() { if (xhr.readyState == 4 && xhr.status == 200) { // If file exists and is accessible, download the file var a = document.createElement('a'); a.href = fileUrl; a.download = 'Investor-Complaint.xls'; // Set the download file name a.click(); } else { alert('File not found or not accessible.'); } }; xhr.send(); }); } else { console.error('Download button not found'); } });

TERMS & CONDITIONS