I have a void Function and I need to return a FileResult or call a FileResult action from this void function. Is there any way that this can be done?
I had devised a workaround, so that the output of my void function is monitored even running asynchronously. I created a javascript window.setInterval function that checks every now and then if the void function has created the final output file which is a zipfile. To monitor this, I used a cookie that has the filename of the zipfile. Once the file is readable, that is the time when I will send the filename to be in a FileResult function.
var exportPhotoBatchck
exportPhotoBatchck = window.setInterval(function () {
var exportcookieValue = $.cookie('ExportBatchToken');
function()
{
//Function that checks whether the cookievalue is a valid file.
}
}, 1000);