1
0
Fork 0
mirror of https://github.com/vbatts/imgsrv.git synced 2025-06-30 14:38:28 +00:00

adding layout for audio mime type files

This commit is contained in:
Vincent Batts 2013-06-03 10:55:04 -04:00
parent f5f345859c
commit eb1946b223
2 changed files with 21 additions and 2 deletions

View file

@ -29,11 +29,16 @@ func (f *File) SetContentType() {
}
func (f *File) IsImage() bool {
f.SetContentType()
f.SetContentType()
return strings.HasPrefix(f.ContentType, "image")
}
func (f *File) IsVideo() bool {
f.SetContentType()
f.SetContentType()
return strings.HasPrefix(f.ContentType, "video")
}
func (f *File) IsAudio() bool {
f.SetContentType()
return strings.HasPrefix(f.ContentType, "audio")
}