根据用户名上传文件到用户名的目录下
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
string uploadPath = Server.MapPath(Request.ApplicationPath + "/Upload/" + SysUser.UserName);
if (Directory.Exists(uploadPath) == false)
{
Directory.CreateDirectory(uploadPath);
}
for (int j = 0; j < Request.Files.Count; j++)
{
HttpPostedFile uploadFile = Request.Files[j];
if (uploadFile.ContentLength > 0)
{
uploadFile.SaveAs(Path.Combine(uploadPath, uploadFile.FileName));
}
}