提交代码
This commit is contained in:
@@ -49,7 +49,7 @@ namespace FineUIPro.Web.AttachFile
|
||||
// 文件名完整路径
|
||||
string fileName = postedFile.FileName;
|
||||
// 文件名保存的服务器路径
|
||||
string savedFileName = GetSavedFileName(fileName).Replace('#', '-'); ;
|
||||
string savedFileName = GetSavedFileName(fileName,owner).Replace('#', '-'); ;
|
||||
postedFile.SaveAs(context.Server.MapPath("~/" + attachPath + "/" + savedFileName));
|
||||
|
||||
string shortFileName = GetFileName(fileName);
|
||||
@@ -123,11 +123,13 @@ namespace FineUIPro.Web.AttachFile
|
||||
return shortFileName;
|
||||
}
|
||||
|
||||
private string GetSavedFileName(string fileName)
|
||||
private string GetSavedFileName(string fileName,string owner)
|
||||
{
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
|
||||
if (!owner.Contains("DocAttachUrl"))
|
||||
{
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
}
|
||||
return fileName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user