|
|
|
@ -1524,6 +1524,14 @@ namespace DSWeb.Areas.Account.Controllers
|
|
|
|
|
}
|
|
|
|
|
string fileOriginalName = Path.GetFileNameWithoutExtension(imgFile.FileName);
|
|
|
|
|
String fileExt = Path.GetExtension(imgFile.FileName).ToLower();
|
|
|
|
|
|
|
|
|
|
if (fileExt == ".asp" || fileExt == ".aspx")
|
|
|
|
|
{
|
|
|
|
|
jsonRespose.Success = false;
|
|
|
|
|
jsonRespose.Message = "不允许上传ASP或ASPX文件";
|
|
|
|
|
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String newFileName = DateTime.Now.ToString("yyyyMMddHHmmss_ffff", DateTimeFormatInfo.InvariantInfo) + idx.ToString() + fileExt;
|
|
|
|
|
String filePath = dirPath + newFileName;
|
|
|
|
|
imgFile.SaveAs(filePath);
|
|
|
|
|