FileInfo DownloadFile = new FileInfo(Server.MapPath("tmp\\")+FullFileName);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = true;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(FullFileName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
这是下载文件代码 FullFileName 为文件名称
Response.Clear();
Response.ClearHeaders();
Response.Buffer = true;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition","attachment;filename="+HttpUtility.UrlEncode(FullFileName,System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length",DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();
这是下载文件代码 FullFileName 为文件名称
gwwwSetupHttpResponseHeader(res, HTTP_VERSION_1_0, HTTP_SC_OK, NULL, NCS_HTTP_SERVER_NAME, MEDIA_TYPE_TEXT_HTML_UTF8, resHtmlSize, FALSE, TRUE);
ret = HttpConnection_write(httpc, resHtml, resHtmlSize);