羞辱尤娜2,花魁女帝txt,男人不难嫁主题曲
//上传图片
$("#file").change(function () {
var getimgdata = new formdata($("#formdata")[0]);
$.ajax({
url: "/weektest3view/uploadingfile",
contenttype: false,
processdata: false,
cache: false,
type: 'post',
data: getimgdata,
success: function (data) {
$("#displayimage").attr("src", data);
$("input[name=filename]").val(data);
}
});
});
view控制器:
/// <summary>
/// 上传图片
/// </summary>
/// <returns></returns>
[httppost]
public string uploadingfile()
{
httppostedfilebase getfile = request.files["file"];
if (getfile != null)
{
string getpath = server.mappath("~/image/");
if (!directory.exists(getpath))
{
directory.createdirectory(getpath);
}
string newpath = path.combine(getpath, getfile.filename);
getfile.saveas(newpath);
return "/image/" + getfile.filename;
}
else
{
return null;
}
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论