<?php
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
// echo "1";
ob_start();
$crc = filter_var($_GET['crc']);
$file = $_SESSION['defaprotect' . $crc];
// echo $file;
if ($headerurl = @get_headers($file, 1)['Location']) {
   
    if (!empty($headerurl)) {
        $file = $headerurl;
    }

}
if (isset($_SERVER['HTTP_RANGE'])) {
    $opts['http']['header'] = "Range: " . $_SERVER['HTTP_RANGE'];
    $opts['http']['method'] = "GET";
    $cong = stream_context_create($opts);
    ob_end_clean();
    readfile($file, false, $cong);
    exit();
}
return $file;

// return  header("Location: http://vision.at-webs.hk/admin/testviewer/viewerjs-demo-master5/ViewerJS/#http://vision.at-webs.hk/upload/newtestupload/8d304ea15d04c76801.odp");

// return  header("Location: defavid3.php");
