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

This commit is contained in:
Kim Carlbäcker authored and Unknwon committed 2016-04-26 21:48:44 -04:00
1 parent 0325bec283
commit 3df8eb60e3
95 files changed
+64456 -1

No files matched your search

+8
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
}