System.IO.FileInfo file = new System.IO.FileInfo(filepath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End(); Response.Flush();
Response.Clear();执行到Response.End(); 弹出对话框说:无法复制文件:无法读源文件或磁盘。
调试filepath路径是正确
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End(); Response.Flush();
Response.Clear();执行到Response.End(); 弹出对话框说:无法复制文件:无法读源文件或磁盘。
调试filepath路径是正确
解决方案 »
- 怎么让窗体中控件的位置与大小与窗体保持一致
- DefaultCellStyle.Format提问
- textbox 显示数字问题
- 属性的static问题
- wpf中listview treeview问题集合
- 固定字体大小问题
- *****************问个矢量图问题!!!!!!!!!!!***********************
- 有问题请教!
- c#winform中对treeview的节点后面添加一个textbox控件,在选择该节点时可以输入内容,并且可以折叠
- dll调用---输入数组引用错误,急,在线等,结案马上给分----兄弟姐妹救助,谢谢了!!!
- Activator.CreateInstance的用法
- 问一下datetimepicker控件能不能默认为null
Response.End();