<?php 
$f=$_POST['file'];
$a=$_POST['user_applno']??'Llexam_'.time();
$e=(strpos($f,'pdf')!==false?'pdf':(strpos($f,'png')!==false?'png':(strpos($f,'jpeg')!==false||strpos($f,'jpg')!==false?'jpg':'file')));
header('Content-Type: application/octet-stream');
header("Content-Disposition: attachment; filename={$a}.{$e}");
echo strpos($f,'base64,')!==false?base64_decode(explode('base64,',$f)[1]):file_get_contents($f);
exit;
?>
