/** * Handles the upload process of a media, sets the mime_type, when success * * @author Max Milbers * @param string $urlfolder relative url of the folder where to store the media * @return name of the uploaded file */ function uploadFile($urlfolder, $overwrite = false) { if (!class_exists('vmUploader')) { require VMPATH_ADMIN . DS . 'helpers' . DS . 'vmuploader.php'; } $r = vmUploader::uploadFile($urlfolder, $this, $overwrite); return $r; }
static function getSafeExt2MimeArray() { if (self::$fT === null) { self::$fT = array(); self::$fT['txt'] = 'text/plain'; self::$fT['pdf'] = 'application/pdf'; self::$fT['zip'] = 'application/zip'; self::$fT['doc'] = 'application/msword'; self::$fT['xls'] = 'application/vnd.ms-excel'; self::$fT['ppt'] = 'application/vnd.ms-powerpoint'; self::$fT['gif'] = 'image/gif'; self::$fT['png'] = 'image/png'; self::$fT['jpeg'] = 'image/jpg'; self::$fT['jpg'] = 'image/jpg'; self::$fT['rar'] = 'application/x-rar-compressed'; self::$fT['epub'] = 'application/epub+zip'; self::$fT['ra'] = 'audio/x-pn-realaudio'; self::$fT['ram'] = 'audio/x-pn-realaudio'; self::$fT['ogg'] = 'audio/x-pn-realaudio'; self::$fT['wav'] = 'audio/wav'; self::$fT['wmv'] = 'video/x-msvideo'; self::$fT['avi'] = 'video/x-msvideo'; self::$fT['asf'] = 'video/x-msvideo'; self::$fT['divx'] = 'video/x-msvideo'; self::$fT['mid'] = 'audio/midi'; self::$fT['midi'] = 'audio/midi'; self::$fT['mp3'] = 'audio/mpeg'; self::$fT['mp4'] = 'audio/mpeg'; self::$fT['mpeg'] = 'video/mpeg'; self::$fT['mpg'] = 'video/mpeg'; self::$fT['mpe'] = 'video/mpeg'; self::$fT['mov'] = 'video/quicktime'; self::$fT['3gp'] = 'video/quicktime'; self::$fT['m4a'] = 'video/quicktime'; self::$fT['aac'] = 'video/quicktime'; self::$fT['m3u'] = 'video/quicktime'; } return self::$fT; }