<?php
//http://103.141.9.234/hydro/module/common/view_file.php?file_id=2402118535
$connection = oci_connect('hidm', 'Hdm$436#', '172.31.11.41:1521/hidb');
$id = $_GET['file_id'];
$sql = "SELECT DATA,MIME FROM SITE_PAYMENT_DOC_STORAGE WHERE NAME='$id'";
$stmm1 = oci_parse($connection, $sql);
oci_execute($stmm1);
$row = oci_fetch_array($stmm1, OCI_ASSOC+OCI_RETURN_NULLS);
if (!$row) {
    header('Status: 404 Not Found');
} else {
    $img = $row['DATA']->load();
	header('Content-type:' . $row['MIME']);
    //header("Content-type: image/jpeg");
    print $img;
}
oci_free_statement($stmm1);
oci_close($connection);
?>