Subsonic 단순화 성 업로드 이미지
-
19-09-2019 - |
문제
몇 달 동안 단순한 위치를 사용해 왔으며 처음으로 데이터베이스에 이미지/문서를 업로드하고 저장해야합니다.
내 수업은 다음과 같이 보입니다.
public class Document: ObjectMetaData
{
public string FileName { get; set; }
public Guid UserId { get; set; }
public DocumentType DocumentType { get; set; }
public string DocumentLocation { get; set; }
public byte[] DocumentData { get; set; }
}
public enum DocumentType
{
EmploymentContractSigned = 1,
EmploymentContractUnSigned = 2
}
DB에 데이터를 지속하면 Subonic은 "DocumentData"를 무시합니다.
그렇다면 파일을 DB에 어떻게 저장합니까?
- documantdata = file.readallbytes ( "somefile.doc")
해결책
Github에 대한 답변을 찾았으며,이 문제는 나중에 릴리스 중 하나에서 해결되었습니다. http://github.com/inbox/555338#reply
제휴하지 않습니다 StackOverflow