// The following possible query string formats are assumed // // 1. ?temp_dir_sid=path_to_temp_dir&start_time=upload_start_time&total_upload=total_upload_size&cedric_progress_bar=1or0&rnd_id=some_random_number // 2. ?cmd=about ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //load the needed javascripts in inner_main.htm $which_java1 = "phphomtion_uploader.js"; $which_java2 = "uploader_bar.js"; require "uploader_conlib.php"; $THIS_VERSION = "1.2"; if (isset($_GET['cmd']) && $_GET['cmd'] == 'about') { kak("<u><b>UBER UPLOADER GET PROGRESS BAR STATUS</b></u><br>UBER UPLOADER VERSION = <b>" . $UBER_VERSION . "</b><br>UU_GET_STATUS = <b>" . $THIS_VERSION . "<b><br>\n"); } elseif (!isset($_GET['temp_dir_sid']) || !isset($_GET['start_time']) || !isset($_GET['total_upload_size'])) { kak("<font color='red'>ERROR</font>: Invalid parameters passed<br>"); } $status = GetBytesRead($_GET['temp_dir_sid']); $uploaded_files = $status[0]; $bRead = $status[1]; $flength_file = $_GET['temp_dir_sid'] . "/flength"; $lapsed = time() - $_GET['start_time']; $bSpeed = 0; $remaining = 0; if ($lapsed > 0) { $bSpeed = $bRead / $lapsed; } if ($bSpeed > 0) { $remaining = round(($_GET['total_upload_size'] - $bRead) / $bSpeed); } //If Cedric progress bar is enabled, calculate smooth speeds if ($_GET['cedric_progress_bar']) { if ($bSpeed != 0) {
$THIS_VERSION = "1.2"; // Version of this file $UPLOAD_ID = ''; // Initialize upload id require 'ubr_ini.php'; require 'ubr_lib.php'; if($PHP_ERROR_REPORTING){ error_reporting(E_ALL); } ob_start(); if(preg_match("/^[a-zA-Z0-9]{32}$/", $_GET['upload_id']) && isset($_GET['start_time']) && isset($_GET['total_upload_size'])){ $UPLOAD_ID = $_GET['upload_id']; } elseif(isset($_GET['about']) && $_GET['about'] == 1){ kak("<u><b>UBER UPLOADER GET PROGRESS</b></u><br>UBER UPLOADER VERSION = <b>" . $UBER_VERSION . "</b><br>UBR_GET_PROGRESS = <b>" . $THIS_VERSION . "<b>", 1, __LINE__); } else{ kak("<font color='red'>ERROR</font>: Invalid parameters passed<br>", 1, __LINE__); } $read_status = GetBytesRead($TEMP_DIR, $UPLOAD_ID); if($read_status->active && $read_status->bytes_uploaded < $_GET['total_upload_size']){ $lapsed_time = time() - $_GET['start_time']; if($DEBUG_AJAX){ showDebugMessage("Set progress: bytes uploaded=" . $read_status->bytes_uploaded . " lapsed time=" . $lapsed_time . " uploaded files=" . $read_status->uploaded_files); } setProgressStatus($read_status->bytes_uploaded, $lapsed_time, $read_status->uploaded_files); getProgressStatus($GET_PROGRESS_SPEED); } else{ stopDataLoop(); hideProgressBar(); if($DEBUG_AJAX){ if(!$read_status->active && $read_status->is_dir_error && !$embedded_upload_results){