Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ajaxCallToExpandController(requestUrl, formData) {
- $.ajax({
- url: requestUrl,
- type: "POST",
- data: formData,
- contentType: false,
- processData: false,
- success: function (excelByteResult) {
- var bytes = base64ToBytes(excelByteResult.base64String);
- var blob = new Blob([bytes], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" });
- const url = window.URL.createObjectURL(blob);
- const a = document.createElement('a');
- a.style.display = 'none';
- a.href = url;
- a.download = excelByteResult.excelFilename;
- document.body.appendChild(a);
- a.click();
- window.URL.revokeObjectURL(url);
- },
- error: function (jqXHR, textStatus, errorThrown) {
- console.log("Xhr: " + jqXHR.responseText);
- console.log("Status: " + status);
- console.log("Error Thrown: " + errorThrown);
- }
- });
- }
Add Comment
Please, Sign In to add comment