" . print_r($_FILES['vfile'], true) . "

"; // exit; //} if (isset($_GET['vtype'])) { if (strpos($_GET['vtype'], "image/") !== false) { header("Location: " . $_GET['vfilename']); exit; } } $tword = "video"; $video_ogg = '.ogv" type="video/ogg" /> '; $video_mp4 = '.mp4" type="video/mp4" /> '; $videomp4 = '.mp4" '; $video_webm = '.webm" type="video/webm" /> '; $videowebm = '.webm" '; $ivmt = ""; $extinfo = ".ogv/.mp4/.webm"; $ivfilene = ""; $ivn = ""; $ipadplace = ""; $preext = ""; $premime = ""; $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad'); if ($isiPad === false) { $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPhone'); } if ($isiPad === false) { $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'Android'); } function url_exists($url) { // Thanks to http://stackoverflow.com/questions/2280394/how-can-i-check-if-a-url-exists-via-php $exists = false; if (strpos($url, "https:") !== false) { if (!$fp = curl_init($url)) return false; return true; } else { $file = $url; $file_headers = @get_headers($file); if (strpos($file_headers[0], " 404 ") !== false) { // == 'HTTP/1.1 404 Not Found') { $exists = false; } else { $exists = true; } } return $exists; } function waitforchange() { set_time_limit(0); while(!isset($_POST['vfilename'])) { clearstatcache(); usleep(10000); } return ""; } function uflist($inext) { global $extinfo, $ivfilene, $isiPad, $preext, $premime, $ivn; $howmany = 0; $outoptions = ""; $outext = "$@#!"; if (strpos($ivfilene, ".") !== false) { $stuff = explode("/", $ivfilene); if (strpos($stuff[sizeof($stuff) - 1], ".") !== false) { $stuffdot = explode(".", $stuff[sizeof($stuff) - 1]); $outext = "." . $stuffdot[sizeof($stuffdot) - 1]; } } // Mime types ... thanks to http://webdesign.about.com/od/multimedia/a/mime-types-by-content-type.htm and // http://voice.firefallpro.com/2012/03/html5-audio-video-mime-types.html $earray = array( "audio/mp4" => ".m4a", "audio/ogg" => ".ogg", "audio/basic" => ".au", "audio/basic" => ".snd", "audio/mid" => ".mid", "audio/mid" => ".rmi", "audio/mpeg" => ".mp3", "audio/x-aiff" => ".aif", "audio/x-aiff" => ".aifc", "audio/x-aiff" => ".aiff", "audio/x-mpegurl" => ".m3u", "audio/x-pn-realaudio" => ".ram", "audio/x-wav" => ".wav", "image/bmp" => ".bmp", "image/cis-cod" => ".cod", "image/gif" => ".gif", "image/ief" => ".ief", "image/jpeg" => ".jpe", "image/jpeg" => ".jpeg", "image/jpeg" => ".jpg", "image/pipeg" => ".jfif", "image/svg+xml" => ".svg", "image/tiff" => ".tif", "image/tiff" => ".tiff", "image/x-cmu-raster" => ".ras", "image/x-cmx" => ".cmx", "image/x-icon" => ".ico", "image/x-portable-anymap" => ".pnm", "image/x-portable-bitmap" => ".pbm", "image/x-portable-graymap" => ".pgm", "image/x-portable-pixmap" => ".ppm", "image/x-rgb" => ".rgb", "image/x-xbitmap" => ".xbm", "image/x-xpixmap" => ".xpm", "image/x-xwindowdump" => ".xwd", "video/mp4" => ".m4v", "video/mpeg" => ".mp2", "video/mpeg" => ".mpa", "video/mpeg" => ".mpe", "video/mpeg" => ".mpeg", "video/mpeg" => ".mpg", "video/mpeg" => ".mpv2", "video/quicktime" => ".mov", "video/quicktime" => ".qt", "video/x-la-asf" => ".lsf", "video/x-la-asf" => ".lsx", "video/x-ms-asf" => ".asf", "video/x-ms-asf" => ".asr", "video/x-ms-asf" => ".asx", "video/x-msvideo" => ".avi", "video/x-sgi-movie" => ".movie", "video/ogg" => ".ogv", "video/webm" => ".webm" ); foreach ($earray as $sext => $key) { if (url_exists(str_replace($outext, "", $ivfilene) . $earray[$sext])) { if (($earray[$sext] == $outext || $earray[$sext] == $inext) && (strpos($sext, "video/") !== false || strpos($sext, "image/") !== false)) { if ($earray[$sext] != ".ogg" && $earray[$sext] != ".ogv" && $earray[$sext] != ".wav" && $earray[$sext] != ".mp3") $extinfo = ""; if (strpos($sext, "video/") !== false) { $howmany = $howmany + 1; $outoptions .= ""; } else { $outoptions .= ""; } if ($earray[$sext] == $outext) { if ($premime == "") $premime = $sext; $ivfilene = str_replace($outext, "", $ivfilene); $ivn = str_replace(".ogv", "", str_replace(".ogv.ogv", ".ogv", str_replace($outext, "", $ivn))); } } else if ((strpos($sext, "video/") !== false || strpos($sext, "image/") !== false)) { if ($earray[$sext] != ".ogg" && $earray[$sext] != ".ogv" && $earray[$sext] != ".wav" && $earray[$sext] != ".mp3") $extinfo = ""; if (strpos($sext, "video/") !== false) { $howmany = $howmany + 1; $outoptions .= ""; } else { $outoptions .= ""; } if ($earray[$sext] == $outext) { if ($premime == "") $premime = $sext; $ivfilene = str_replace($outext, "", $ivfilene); $ivn = str_replace(".ogv", "", str_replace(".ogv.ogv", ".ogv", str_replace($outext, "", $ivn))); } } } } if ($howmany == 1 && strpos($outoptions, " selected>") === false && strpos($outext, ".") === false && strpos($outoptions, "video/") !== false) { $outoptions = str_replace("