//FileStream files = new FileStream(filepath, FileMode.Open);
//byte[] fileByte = new byte[files.Length];
//files.Read(fileByte, 0, fileByte.Length);
//files.Close();
//System.IO.MemoryStream ms = new MemoryStream(fileByte, 0, fileByte.Length);
Response.ClearContent();
switch (data.F_FileType)
{
case "jpg":
Response.ContentType = "image/jpeg";
break;
case "gif":
Response.ContentType = "image/gif";
break;
case "png":
Response.ContentType = "image/png";
break;
case "bmp":
Response.ContentType = "application/x-bmp";
break;
case "jpeg":
Response.ContentType = "image/jpeg";
break;
case "doc":
Response.ContentType = "application/pdf";
break;
case "docx":
Response.ContentType = "application/pdf";
break;
case "ppt":
Response.ContentType = "application/x-ppt";
break;
case "pptx":
Response.ContentType = "application/x-ppt";
break;
case "xls":
Response.ContentType = "application/pdf";
break;
case "xlsx":
Response.ContentType = "application/pdf";
break;
case "pdf":
Response.ContentType = "application/pdf";
break;
case "txt":
Response.ContentType = "text/plain";
break;
case "csv":
Response.ContentType = "";
break;
default:
Response.ContentType = "application/pdf";
break;
}
Response.Charset = "GB2312";
Response.WriteFile(filepath);
//Response.BinaryWrite(ms.ToArray());
}
#endregion
}
}
+ 2- 13
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/EnrollData/EnrollDataService.cs파일 보기