我有以下代碼,允許用戶下載文件。我需要知道(如果可能)他們是否成功下載了文件。有什麼樣的回調,我可以把它們知道他們是否成功地下載它?謝謝。如何確定文件是否已下載
string filename = Path.GetFileName(url);
context.Response.Buffer = true;
context.Response.Charset = "";
context.Response.Cache.SetCacheability(HttpCacheability.NoCache);
context.Response.ContentType = "application/x-rar-compressed";
context.Response.AddHeader("content-disposition", "attachment;filename=" + filename);
context.Response.TransmitFile(context.Server.MapPath(url));
context.Response.Flush();
我想這是我的問題。我不知道它是否在transmitfile調用之後繼續同步,或者它是否只是調用它,讓它做它的事情,然後調用flush。我會試一試。謝謝。 – geoff 2009-10-06 17:29:39