前台:
<asp: FileUpload ID ="FileUpload1" runat="server" AllowMultiple="true" />
後台:
foreach (HttpPostedFile postedFile in FileUpload1.PostedFiles)
{
fileName = postedFile.FileName;
FileNameAll = FileNameAll + fileName + ",";
// –完成檔案上傳的動作。
savePath = appPath + saveDir + fileName;
postedFile.SaveAs(savePath);
}
PostedFiles這個函數,在4.5才有喔!切記!