|
|
@ -4612,6 +4612,7 @@ namespace BP.WF.HttpHandler
|
|
|
|
HttpPostedFile file = HttpContextHelper.RequestFiles(i);
|
|
|
|
HttpPostedFile file = HttpContextHelper.RequestFiles(i);
|
|
|
|
|
|
|
|
|
|
|
|
string fileName = System.IO.Path.GetFileName(file.FileName);
|
|
|
|
string fileName = System.IO.Path.GetFileName(file.FileName);
|
|
|
|
|
|
|
|
fileName = ToDBC(fileName);
|
|
|
|
|
|
|
|
|
|
|
|
#region 文件上传的iis服务器上 or db数据库里.
|
|
|
|
#region 文件上传的iis服务器上 or db数据库里.
|
|
|
|
if (athDesc.AthSaveWay == AthSaveWay.IISServer)
|
|
|
|
if (athDesc.AthSaveWay == AthSaveWay.IISServer)
|
|
|
@ -4668,10 +4669,10 @@ namespace BP.WF.HttpHandler
|
|
|
|
|
|
|
|
|
|
|
|
string guid = DBAccess.GenerGUID();
|
|
|
|
string guid = DBAccess.GenerGUID();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//string realSaveTo = savePath + "/" + guid + "." + fileName;
|
|
|
|
|
|
|
|
string realSaveTo = savePath + "/" + fileName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string realSaveTo = savePath + "/" + guid + "." + fileName;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
realSaveTo = realSaveTo.Replace("~", "-");
|
|
|
|
realSaveTo = realSaveTo.Replace("~", "-");
|
|
|
|
realSaveTo = realSaveTo.Replace("'", "-");
|
|
|
|
realSaveTo = realSaveTo.Replace("'", "-");
|
|
|
|
realSaveTo = realSaveTo.Replace("*", "-");
|
|
|
|
realSaveTo = realSaveTo.Replace("*", "-");
|
|
|
@ -4756,7 +4757,6 @@ namespace BP.WF.HttpHandler
|
|
|
|
dbUpload.FileFullName = dbUpload.MyPK;
|
|
|
|
dbUpload.FileFullName = dbUpload.MyPK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion 处理文件路径,如果是保存到数据库,就存储pk.
|
|
|
|
#endregion 处理文件路径,如果是保存到数据库,就存储pk.
|
|
|
|
|
|
|
|
|
|
|
|
dbUpload.FileName = fileName;
|
|
|
|
dbUpload.FileName = fileName;
|
|
|
|
dbUpload.FileSize = (float)info.Length;
|
|
|
|
dbUpload.FileSize = (float)info.Length;
|
|
|
|
dbUpload.RDT = DataType.CurrentDateTimess;
|
|
|
|
dbUpload.RDT = DataType.CurrentDateTimess;
|
|
|
@ -4936,6 +4936,33 @@ namespace BP.WF.HttpHandler
|
|
|
|
return "{\"msg\":\"上传成功\"}";
|
|
|
|
return "{\"msg\":\"上传成功\"}";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
|
/// 转半角(DBC case)
|
|
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
|
|
/// <param name="input">任意字符串</param>
|
|
|
|
|
|
|
|
/// <returns>半角字符串</returns>
|
|
|
|
|
|
|
|
public string ToDBC(string input)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char[] c = input.ToCharArray();
|
|
|
|
|
|
|
|
for (int i = 0; i < c.Length; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (c[i] == 12288)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
c[i] = (char)32;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c[i] == 160)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
c[i] = (char)32;
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (c[i] > 65280 && c[i] < 65375)
|
|
|
|
|
|
|
|
c[i] = (char)(c[i] - 65248);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
string s = new string(c);
|
|
|
|
|
|
|
|
return s;
|
|
|
|
|
|
|
|
}
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 删除附件
|
|
|
|
/// 删除附件
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
@ -5643,7 +5670,7 @@ namespace BP.WF.HttpHandler
|
|
|
|
FrmAttachmentDB downDB = new FrmAttachmentDB();
|
|
|
|
FrmAttachmentDB downDB = new FrmAttachmentDB();
|
|
|
|
|
|
|
|
|
|
|
|
downDB.MyPK = this.MyPK;
|
|
|
|
downDB.MyPK = this.MyPK;
|
|
|
|
downDB.Retrieve();
|
|
|
|
downDB.RetrieveFromDBSources();
|
|
|
|
FrmAttachment dbAtt = new FrmAttachment();
|
|
|
|
FrmAttachment dbAtt = new FrmAttachment();
|
|
|
|
dbAtt.MyPK = downDB.FK_FrmAttachment;
|
|
|
|
dbAtt.MyPK = downDB.FK_FrmAttachment;
|
|
|
|
dbAtt.Retrieve();
|
|
|
|
dbAtt.Retrieve();
|
|
|
@ -5679,6 +5706,12 @@ namespace BP.WF.HttpHandler
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
filepath = downDB.FileFullName;
|
|
|
|
filepath = downDB.FileFullName;
|
|
|
|
|
|
|
|
int splitStartIndex = filepath.IndexOf("DataUser/");
|
|
|
|
|
|
|
|
if(splitStartIndex > -1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return "/" + filepath.Substring(splitStartIndex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//return filepath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -5710,7 +5743,16 @@ namespace BP.WF.HttpHandler
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
BP.WF.HttpHandler.HttpHandlerGlo.DownloadFile(filepath, downDB.FileName);
|
|
|
|
BP.WF.HttpHandler.HttpHandlerGlo.DownloadFile(filepath, downDB.FileName);
|
|
|
|
return DataType.PraseStringToUrlFileName(filepath);
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
filepath = DataType.PraseStringToUrlFileName(filepath);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
throw new Exception (ex.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return filepath;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|