1
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Text;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
@@ -44,6 +45,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取多附件数据流类
|
||||
/// </summary>
|
||||
@@ -61,18 +63,30 @@ namespace BLL
|
||||
{
|
||||
if (strs.Count() > i)
|
||||
{
|
||||
//string physicalpath = Funs.AttachRootPath;
|
||||
string physicalpath = Funs.RootPath;
|
||||
//HttpContext.Current.Request.PhysicalApplicationPath;
|
||||
string fullPath = physicalpath + strs[i];
|
||||
string fpath = strs[i];
|
||||
string fullPath = physicalpath + fpath;
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
byte[] fileContext = item;
|
||||
int index = fullPath.LastIndexOf("\\");
|
||||
string filePath = fullPath.Substring(0, index);
|
||||
string fileName = Regex.Match(fullPath, @"[^/\\?]+(\?.*)?$").Value;
|
||||
string filePath = fullPath.Replace(fileName, "");
|
||||
//int index = fullPath.LastIndexOf("\\");
|
||||
//string filePath = fullPath.Substring(0, index) ;
|
||||
//string filePath = index > 0 ? fullPath.Substring(0, index) : fullPath;
|
||||
|
||||
if (!Directory.Exists(filePath))
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ErrLogInfo.WriteLog($"附件【{filePath}】获取异常!");
|
||||
//continue;
|
||||
}
|
||||
//string savePath = fullPath + fileName;
|
||||
|
||||
@@ -93,6 +107,7 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 数据和附件插入到多附件表
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user