IOS 上传图片到ASP.NET
程序员文章站
2023-02-28 12:11:19
ASP.NET服务端的代码:
[csharp]
1. protected void Page_Load(object sender, EventArgs e) &...
ASP.NET服务端的代码:
[csharp]
1. protected void Page_Load(object sender, EventArgs e)
2. {
3. if (Request.Files.Count == 0)
4. {
5. Response.Write("none file");
6. }
7. else
8. {
9. HttpPostedFile file = Request.Files["img"];
10. String filename = Request.Form["name"];
11. file.SaveAs(MapPath("~/"+filename+".png"));
12.
13. Response.Write("ok");
14. }
15. }