ダウンロードを実行してからコードを続行する必要がありますか?どうすればいいですか?
この関数は、ファイルがサーバーにダウンロードされているかどうかをチェックしています。次に、クライアントコンピューターにダウンロードを実行する必要があります。ここで、window.open( "url")を試してみます。
function checkSpreadsheetProgress(taskId, filename) {
var intervalId2 = setInterval(function () {
$.post("SpreadSheetProgress", { id: taskId }, function (SpreadSheetProgress) {
if (SpreadSheetProgress >= 100) {
clearInterval(intervalId2);
window.open("http://formvalue.co.za/download/" + filename + ".xlsx")
//The line above is my attempt at running the download link but it did nothing?
//The line below pushes me to my Downloadcompleate action result.
window.location.href = "downloadcomplete?filename=" + filename;
} else {
}
});
}, 100);
}
C#でファイルをダウンロードできますが、リダイレクトメソッドの背後にあるコードを続行できません。
public ActionResult DownloadComplete(string filename)
{
//return Redirect("http://formvalue.co.za/download/" + filename + ".xlsx");
// The above line will download the file but then i cant return a view?
return View();
}