foreach (UploadedFile file in RadUploadContext.Current.UploadedFiles)
{
string Path = Server.MapPath(@"~/Uploads");
//如果路径不存在,则创建
if (System.IO.Directory.Exists(Path) == false)
{
System.IO.Directory.CreateDirectory(Path);
}
//组合路径,file.GetName()取得文件名
string oldfilename = file.GetName().ToString();
//如果对上传后的文件进行重新命名,根据guid进行命名,则放开下面二行代码
//string fileType = oldfilename.Substring(oldfilename.LastIndexOf("."));
//string newfilename = Guid.NewGuid().ToString("N") + fileType;
//Path = Path + "/" + file.GetName().ToString();
Path = Path + "/" + oldfilename;
//保存
file.SaveAs(Path, true);
string newurl = @"~/Uploads/" + oldfilename;
}