all
This commit is contained in:
11
Downloads/Voltaserve/conversion/helper/mime.go
Normal file
11
Downloads/Voltaserve/conversion/helper/mime.go
Normal file
@ -0,0 +1,11 @@
|
||||
package helper
|
||||
|
||||
import "github.com/gabriel-vasile/mimetype"
|
||||
|
||||
func DetectMimeFromFile(path string) string {
|
||||
mime, err := mimetype.DetectFile(path)
|
||||
if err != nil {
|
||||
return "application/octet-stream"
|
||||
}
|
||||
return mime.String()
|
||||
}
|
Reference in New Issue
Block a user