Jquery $fileDownload successcallback not working

I have a javascript function where the successcallback is not being called when excel file is successfully created

Need help!!

function exportToExcelTest() {
        var region = $('#ddlRegion').val();
        var hrinfo = $('#hrinfodropdown').val();
        if (region != null) {
            $.blockUI({ message: '<h1>Please wait generating excel data...</h1>' });
            //$.blockUI({ message: '<h1><img src="../Images/ajax_loader_blue_350.gif" /> Just a moment...</h1>' });
            $.blockUI({ css: { backgroundColor: '#f00', color: '#fff'} });
            var myData = region + ':' + hrinfo;
            $.fileDownload('Excel.ashx', {
                httpMethod: "POST",
                data: { data: myData },
                successCallback: function (url) {
                    //response.setHeader("Set-Cookie", "fileDownload=false; path=/");
                prepareCallback: function (url) {
                    //response.setHeader("Set-Cookie", "fileDownload=true; path=/");
                failCallback: function (responseHtml, url) {
                    // $("div#loading").hide();
                    // alert('Error while generating excel file');
                    //response.setHeader("Set-Cookie", "fileDownload=false; path=/");
        else {
            alert('Please select a region....');
            return false;

Open in new window

Mauro CazabonnetSenior .NET Software EngineerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steven KribbeSoftware EngineerCommented:
Is none of the callback function being called when the file has been created?
Mauro CazabonnetSenior .NET Software EngineerAuthor Commented:
Out of the 3 callbacks
prepareCallBack is working
Steven KribbeSoftware EngineerCommented:
In the latest version I see the callback functions have been renamed to done and fail.....


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Mauro CazabonnetSenior .NET Software EngineerAuthor Commented:
Thanks, read thru the documentation, needed to set a cookie value when file was successfully created
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.