示例#1
0
        private byte[] GetImageBytesFromFilePath(string fileName, string rootPath)
        {
            byte[] content  = null;
            string filePath = ImageUploadHelper.GetUploadRootPath(rootPath) + "Temp\\" + fileName;

            if (File.Exists(filePath))
            {
                using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.Read))
                {
                    content = fs.ToBytes();
                }
            }

            return(content);
        }