public function getMediaType()
    {
        if ($this->hasMoved()) {
            throw new \RuntimeException(sprintf('Uploaded file "%s" has already moved', $this->file));
        }

        if (extension_loaded('fileinfo')) {
            $finfo = finfo_open(FILEINFO_MIME);
            $mime = finfo_file($finfo, $this->file);
            finfo_close($finfo);

            $mime = explode(";", $mime);
            $mime = trim($mime[0]);

            return $mime;
        } else {
            throw new \RuntimeException(sprintf('You must install fileinfo extension to determine the real type of uploaded file "%s"', $this->file));
        }
    }