//DetectContentType will detect the content type of a file.
DetectContentType will detect the content type of a file.
// DetectContentType will detect the content type of a file .
func DetectContentType(path string) (string, error) {
	file, err := os.Open(path)
	if err == nil {
		buffer := make([]byte, 512)
		n, err := file.Read(buffer)
		if err == nil {
			return http.DetectContentType(buffer[:n]), nil
		}
	}
	return "", err
}
func DetectContentType ( path string ) ( string , error ) { file , err := os . Open ( path ) if err == nil { buffer := make ( [ ] byte , 512 ) n , err := file . Read ( buffer ) if err == nil { return http . DetectContentType ( buffer [ : n ] ) , nil } } return " " , err }
DetectContentType will detect the content type of a file.
DetectContentType will detect the content type of a file .