2
我打電話這種直接的方法,但是當我嘗試下載文件(路徑是確定和測試),我收到此錯誤:C#下載文件 - BADRESPONSE:無效的或意外的標記
[DirectMethod]
public void downloadFile(string fname, string ftype)
{
HttpContext.Current.Response.ContentType = "APPLICATION/OCTET-STREAM";
String Header = "Attachment; Filename=" + fname;
HttpContext.Current.Response.AppendHeader("Content-Disposition", Header);
System.IO.FileInfo Dfile = new System.IO.FileInfo(HttpContext.Current.Server.MapPath("CopyFiles\\" + ftype + "\\"+ fname));
HttpContext.Current.Response.WriteFile(Dfile.FullName);
HttpContext.Current.Response.End();
}
BADRESPONSE:無效的或意外的標記