PDF-Previews in file-lists now working (#3000)

This commit is contained in:
Kim Carlbäcker 2016-04-27 03:48:44 +02:00 committed by Unknwon
parent 0325bec283
commit 3df8eb60e3
95 changed files with 64456 additions and 1 deletions

View file

@ -522,3 +522,11 @@ func IsImageFile(data []byte) (string, bool) {
}
return contentType, false
}
func IsPDFFile(data []byte) (string, bool) {
contentType := http.DetectContentType(data)
if strings.Index(contentType, "application/pdf") != -1 {
return contentType, true
}
return contentType, false
}