publicActionResult Upload()
{
// var pathUrl = "http://" + Request.Url.Authority;
var file = Request.Files["Filedata"];
var uploadFileName = file.FileName;
stringfilePath ="/File/"+ uploadFileName;
stringAbsolutePath = Server.MapPath(filePath);
file.SaveAs(AbsolutePath); //将上传的东西保存
returnJson(new{ FileName = uploadFileName, FilePath = filePath });
}
publicActionResult DownLoad(stringFileName)
{
stringfileName = FileName;//客户端保存的文件名
stringfilePath = Server.MapPath("/File/"+ FileName);//路径
//以字符流的形式下载文件
FileStream fs =newFileStream(filePath, FileMode.Open);
byte[] bytes =newbyte[(int)fs.Length];
fs.Read(bytes, 0, bytes.Length);
fs.Close();
Response.ContentType ="application/octet-stream";
//通知浏览器下载文件而不是打开
Response.AddHeader("Content-Disposition","attachment; filename="+ HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
returnJson("");
}
疯狂医院达什医生中文版(Crazy Hospital)
疯狂医院达什医生最新版是一款医院模拟经营类游戏,逼真的场景画
宝宝庄园官方版
宝宝庄园官方版是一款超级经典好玩的模拟经营类型的手游,这个游
桃源记官方正版
桃源记是一款休闲娱乐类的水墨手绘风格打造的模拟经营手游。玩家
长途巴士模拟器手机版
长途巴士模拟器汉化版是一款十分比真好玩的大巴车模拟驾驶运营类
房东模拟器最新版2024
房东模拟器中文版是一个超级有趣的模拟经营类型的手游,这个游戏