Created
September 25, 2016 04:58
-
-
Save isdaviddong/bb205bba7b4ca29e28b552dea0b077e1 to your computer and use it in GitHub Desktop.
非同步上傳檔案後端C# code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void Page_Load(object sender, EventArgs e) | |
{ | |
HttpPostedFile file = null; | |
if (Request.Files.Count > 0) | |
{ | |
//找到檔案 | |
file = Request.Files[0]; | |
//儲存 | |
var filePath = Server.MapPath(System.IO.Path.GetFileName(file.FileName)); | |
file.SaveAs(filePath); | |
//回應訊息 | |
Response.Write(filePath + " saved."); | |
Response.End(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment