//上传:
用个FileUpload1控键
string sFileName;
sFileName = FileUpload1.FileName;
string sFilePath = Server.MapPath("File");
string strPath = System.IO.Path.Combine(sFilePath, FileUpload1.FileName);
FileUpload1.PostedFile.SaveAs(strPath);
//下载:
string filepath = Server.MapPath("File");
string filename = //下载文件名;
string path = filepath + filename;
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;FileName=" + HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8));
Response.WriteFile(path);
Response.End();
浙公网安备 33010602011771号