0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 3.134.84.38


Current Path : /var/www/html/ibm/src/
Upload File :
Current File : /var/www/html/ibm/src/ceckFile.php

<?php

require_once(__DIR__."/../../aws/aws-autoloader.php");
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;

function checkDocument($univcode, $regno, $sem, $type="MC")
{
	// $aobj_context->mobj_db->SetFetchMode(ADODB_FETCH_ASSOC);

	// session_start();
	// $regno = trim($aobj_context->mobj_data["regno"]);
	// $sem = trim($aobj_context->mobj_data["sem"]);
	// $univcode = trim($aobj_context->mobj_data["univcode"]);

	$s3 = S3Client::factory(
		array(
			'credentials' => array(
				'key' => IAM_KEY,
				'secret' => IAM_SECRET
			),
			'version' => "latest",
			'region'  => 'ap-south-1'
		)
	);

	// var_dump($univcode);
	// var_dump($regno);
	// var_dump($sem);

	$type = $sem == "Degree Certificate" ? "DC" : "MC";
	if($type == 'DC')
		$sem = "";
	$bucket = "kuvempu-university-marks-card-verification";
	$objects = $s3->getIterator('ListObjects', array(
    "Bucket" => $bucket,
    "Prefix" => "{$univcode}/{$type}_003_{$regno}_{$sem}"
	));
	$mc = array();
	// var_dump("{$univcode}/{$type}_003_{$regno}_{$sem}");
	foreach ($objects as $object) {
		// var_dump($object);
		array_push($mc,  $object['Key']);
	}

	return $mc;
	
}

?>