上午发贴的问题,没有解决,继续问,来者有分
是关于“多附件下载”的,我数据库字段 "多附件上传地址" 中形式是 :
A:/aaa;B:/bbb;C:/ccc;
下载页面:
下载的时候,先定義一個字符串數組,把分號之間的路径取出來存進數組,然後用一個循環輸出,在循環中调用下载函数如:FileDownload(),这样做可以吗?或者大哥们再提供一个思路。谢谢
private void FileDownload(string filepath)
{
FileInfo DownloadFile = new FileInfo(filepath);
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
Response.WriteFile(DownloadFile.FullName);
Response.Flush();
Response.End();