diff --git a/interfaces/file.go b/interfaces/file.go index 75d73e7..a8edb78 100644 --- a/interfaces/file.go +++ b/interfaces/file.go @@ -13,6 +13,7 @@ type File interface { HashString() string Name() string Modtime() time.Time + Mime() string Size() uint64 CID() *encoding.CID Exists() bool diff --git a/storage/file.go b/storage/file.go index 1e1aea6..f3d9472 100644 --- a/storage/file.go +++ b/storage/file.go @@ -165,3 +165,12 @@ func (f *FileImpl) CID() *encoding.CID { } return f.cid } + +func (f *FileImpl) Mime() string { + record, err := f.Record() + if err != nil { + return "" + } + + return record.MimeType +}