File manager - Edit - /home/autoph/public_html/connect/priv/fetch.php
Back
<?php if( !function_exists('apache_request_headers') ) { /// function apache_request_headers() { $arh = array(); $rx_http = '/\AHTTP_/'; foreach($_SERVER as $key => $val) { if( preg_match($rx_http, $key) ) { $arh_key = preg_replace($rx_http, '', $key); $rx_matches = array(); // do some nasty string manipulations to restore the original letter case // this should work in most cases $rx_matches = explode('_', $arh_key); if( count($rx_matches) > 0 and strlen($arh_key) > 2 ) { foreach($rx_matches as $ak_key => $ak_val) $rx_matches[$ak_key] = ucfirst($ak_val); $arh_key = implode('-', $rx_matches); } $arh[$arh_key] = $val; } } return( $arh ); } /// } /// $headers = apache_request_headers(); if(!isset($headers['App-Dev-Id'])){ echo "Access Denied"; exit; } if($headers['App-Dev-Id'] != "62060a062e22d7678bee0302"){ echo "Invalid Key"; exit; } $path = __DIR__; $latest_ctime = 0; $latest_filename = ''; $d = dir($path); while (false !== ($entry = $d->read())) { $filepath = "{$path}/{$entry}"; // could do also other checks than just checking whether the entry is a file if (is_file($filepath) && filectime($filepath) > $latest_ctime) { $latest_ctime = filectime($filepath); //autohub-dev-autoph_db-20220212_100001.sql.gz if(substr($entry, 0, 27 ) === "autohub-dev-autoph_connect-"){ $latest_filename = $entry; } } } $fp = fopen($latest_filename, 'rb'); header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=$latest_filename"); header("Content-Length: " . filesize($latest_filename)); fpassthru($fp); ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings