初学ASP,不知道文件上传与文件下载怎么弄的,请高手帮忙写个例子给我看看啊 ,谢谢了~
解决方案 »
- document.getElementById 传递参数问题。。。。在线等
- 服务器空间 被上传了莫名的文件 删除不了,怎么办
- 如何使用GridView数据行单击、双击事件
- Gridview 内框设定
- 关闭EXCEL进程时GetWindowThreadProcessId不起作用
- 1个关于AJAX与WEB控件的问题!!高手必进
- 【怎樣在客戶端顯示遠程服務器的系統時間】
- Excel手动转换成Word。 急~~~在线等
- 自定义控件使用方法
- TextBox没有value属性,有什麽办法可使TextBox显示的内容与实际值不一样
- list有办法不循环,直接得到某一个列吗?
- 如何自动识别判断url中的中文参数是GB2312还是Utf-8编码?
if (Fi.Exists)
{
FileStream fs = new FileStream(filePath, FileMode.Open);
byte[] bytes = new byte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=1.excel");
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
}
string path = Server.MapPath("~/") + "";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(obj.Name, System.Text.Encoding.GetEncoding("utf-8")));
Response.ContentType = "application/octet-stream";
Response.WriteFile("" + path + "");
Response.End();
if (fileUpload.HasFile)
{
string savePath = Server.MapPath("~/upload/");
if(!System.IO.Directory.Exists(savePath))
{
System.IO.Directory.CreateDirectory(savePath);
}
savePath = savePath + "\\" + fileUpload.FileName;
fileUpload.SaveAs(savePath);
}
配置httpruntime 中默认大小设置
请帮忙说下了
未能找到路径“C:\Documents and Settings\Administrator\桌面\C#\MultiFileUpload\images\新建 文本文档.txt”的一部分。