public static string GetDisposition(string strType) { // 判断使用浏览器打开还是附件模式 if (ContentTypeDic.GetContentType(strType).StartsWith("image")) { return("inline"); } return("attachment"); }
public FileModel FindFile(string appid, string fileid) { //验证归属方状态,买坑 //查找文件 FileModel file = new FileModel(); var item = _dbHelper.FindOne(col, fileid); file.stream = _dbHelper.OpenDownToStreamByObjectId(ObjectId.Parse(item.fileid.ToString())); file.contentType = ContentTypeDic.GetContentType(item.ext.ToLower()); return(file); }