SVN r450
SVN-Revision: r450
This commit is contained in:
@@ -34,6 +34,7 @@ using Newtonsoft.Json;
|
||||
using Lskj.Business.Impl;
|
||||
using System.Text.RegularExpressions;
|
||||
using Lskj.Util;
|
||||
using System.Web;
|
||||
|
||||
namespace Lskj.PubBomImport
|
||||
{
|
||||
@@ -1193,4 +1194,38 @@ namespace Lskj.PubBomImport
|
||||
{
|
||||
returnMsg = ex.Message;
|
||||
isUpload = false;
|
||||
|
||||
}
|
||||
msg = returnMsg;
|
||||
return isUpload;
|
||||
}
|
||||
/// <summary>
|
||||
/// 附件转换byte[]
|
||||
/// </summary>
|
||||
/// <param name="filePath">附件路径</param>
|
||||
/// <returns>二进制</returns>
|
||||
private byte[] ConvertFileToBytes(string filePath)
|
||||
{
|
||||
byte[] bytContent = null;
|
||||
System.IO.FileStream fs = null;
|
||||
System.IO.BinaryReader br = null;
|
||||
try
|
||||
{
|
||||
fs = new FileStream(filePath, System.IO.FileMode.Open);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fs != null)
|
||||
br = new BinaryReader((Stream)fs);
|
||||
if (br != null)
|
||||
bytContent = br.ReadBytes((Int32)fs.Length);
|
||||
if (fs != null)
|
||||
fs.Dispose();
|
||||
}
|
||||
return bytContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user