File Manager
Pro
/data/web/virtuals/8819/virtual/www/mp3/public/includes
PHP 7.4.33
Linux
/data/web/virtuals/8819/virtual/www/mp3/public/includes/status.php
4.6 KB
0640
Back
<?php error_reporting(0); if(!is_dir(DownloadFolder) && !is_file(DownloadFolder)) { mkdir(DownloadFolder); } if(isset($_POST["url"])) { ini_set(MemoryLimit, "100G"); //,"100GB" set_time_limit(TimeLimit, "0"); $hdrs = get_headers($_POST["url"], 1); if($hdrs) { if(isset($hdrs['Content-Type'])) { if(is_array($hdrs['Content-Type'])) { $cntt = end($hdrs['Content-Type']); echo "File type: $cntt <br />"; } else { echo "File type: ".$hdrs['Content-Type']." <br />"; } } if(isset($hdrs['Content-Length'])) { global $len; if(is_array($hdrs['Content-Length'])) { $len = end($hdrs['Content-Length']); $adi = $len; if($adi > 1024) { $adi /= 1024; $t = "KB"; } if($adi > 1024) { $adi /= 1024; $t = "MB"; } $adi = round($adi, 2); echo "File size: $adi $t <br />"; global $bytmax; $bytmax = $len; } else { $adi = $hdrs['Content-Length']; $t = "Bytes"; if($adi > 1024) { $adi /= 1024; $t = "KB"; } if($adi > 1024) { $adi /= 1024; $t = "MB"; } $adi = round($adi, 2); echo "File size: $adi $t <br />"; global $bytmax; $bytmax = $hdrs['Content-Length']; } } if(isset($hdrs["location"])) { if(is_array($hdrs['location'])) { $lctn = end($hdrs['location']); echo "Redirection: $lctn <br />"; $_POST["url"] = $lctn; } else { echo "Redirection: ".$hdrs['location']." <br />"; $_POST["url"] = $hdrs['location']; } } } function stream_notification_callback($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max) { switch($notification_code) { case STREAM_NOTIFY_RESOLVE: case STREAM_NOTIFY_AUTH_REQUIRED: case STREAM_NOTIFY_COMPLETED: case STREAM_NOTIFY_FAILURE: case STREAM_NOTIFY_AUTH_RESULT: var_dump($notification_code, $severity, $message, $message_code, $bytes_transferred, $bytes_max); break; case STREAM_NOTIFY_CONNECT: echo "<script>document.getElementById('pb').className='progress-bar progress-bar-striped progress-bar-info';document.getElementById('pb').style='width:100%';</script>"; break; case STREAM_NOTIFY_PROGRESS: if($bytes_max) { global $pr; global $bm; $bm = ""; $bm = $bytes_max; $adi = $bytes_transferred; $t = "Bytes"; if($adi > 1024) { $adi /= 1024; $t = "KB"; } if($adi > 1024) { $adi /= 1024; $t = "MB"; } $adi2 = ""; $adi2 = $bytes_max; $t2 = "Bytes"; if($adi2 > 1024) { $adi2 /= 1024; $t2 = "KB"; } if($adi2 > 1024) { $adi2 /= 1024; $t2 = "MB"; } $adi = round($adi, 2); $adi2 = round($adi2, 2); $pr = $bytes_transferred * 100; $pr = $pr / $bytes_max; $pr = intval($pr); } else { $pr = "unknown"; $adi = 0; $t = "Unknown"; $t2 = "Unknown"; $adi2 = 0; } echo "<script>document.getElementById('pb').className='progress-bar progress-bar-striped progress-bar-info active';document.getElementById('pb').style='width:$pr%';document.getElementById('pb').innerHTML='$pr%';document.getElementById('res').innerHTML='progress: $adi $t / $adi2 $t2';document.getElementById('pb').style.width = '$pr%';</script> "; break; } } echo "\n"; $ctx = stream_context_create(); stream_context_set_params($ctx, array("notification" => "stream_notification_callback")); $name = DownloadFolder."/".$_POST["name"]; echo "name: ".$name."<br />"; echo ' <div class="progress"> <div class="progress-bar progress-bar-striped active" role="progressbar" style="width:0%" id="pb"> <span>0% Complete</span> </div> </div><div id="res"></div>'; $put = copy($_POST["url"], $name, $ctx); if($put) { $put = filesize($name); $t2 = "Bytes"; if($put > 1024) { $put /= 1024; $t2 = "KB"; } if($put > 1024) { $put /= 1024; $t2 = "MB"; } $t = "Bytes"; if(!isset($bm)) { $bm = 0; } if($bm > 1024) { $bm /= 1024; $t = "KB"; } if($bm > 1024) { $bm /= 1024; $t = "MB"; } $put = round($put, 2); $bm = round($bm, 2); echo "<script>document.getElementById('pb').style='width:100%';document.getElementById('pb').innerHTML='100%';document.getElementById('pb').className='progress-bar progress-bar-striped progress-bar-success';document.getElementById('res').innerHTML='$put $t2/$bm $t';document.getElementById('pb').style.width = '100%';</script> "; } } ?>
Cancel
Download
Save changes
File Manager Pro · single-file PHP 7.4.33 on Linux · paths encrypted in URL (AES-256-CTR)