array('avi', 'mp4', '3gp', 'mpg', 'mpeg', 'mov', 'flv', 'wmv'), 'audio' => array('mp3'), 'block' => array('exe', 'scr', 'msi', 'com', 'cmd', 'bat', 'reg', 'pif', 'vbs', 'js', 'hta') /* Block non allowed fileExts (List May Be Incomplete) */ ); // File Ext Check $fExt = (strpos($lname, '.') !== false) ? strtolower(substr(strrchr($lname, '.'), 1)) : ''; $type = 'doc'; foreach ($fileExts as $t => $exts) { if (in_array($fExt, $exts)) { $type = $t; break; } } // Convert Upload Types if ($type == 'audio' && $upload_audio_as_video) $type = 'video'; elseif ($type == 'video' && $upload_video_as_doc) $type = 'doc'; // Check Type Limits switch ($type) { case 'block': html_error("This file ext. ($fExt) isn't allowed by VK."); case 'audio': case 'doc': if ($fsize > 200*1024*1024) html_error("You only can upload '$type' files up to 200 MB."); } // Check https support for login. $usecurl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false; $chttps = false; if ($usecurl) { $cV = curl_version(); if (in_array('https', $cV['protocols'], true)) $chttps = true; } if (!extension_loaded('openssl') && !$chttps) html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.'); elseif (!$chttps) $usecurl = false; $auth_url = 'https://oauth.vk.com/authorize?client_id='.urlencode($app['id']).'&display=popup&scope=audio,video,docs,offline&response_type=code&redirect_uri='.urlencode($return_url); if (empty($_REQUEST['code'])) { echo "\n\n