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 : 18.118.19.89
Current Path : /var/www/oasis/dud/ |
| Current File : /var/www/oasis/dud/upload_studymat_bcu.php |
<?php
$univcode = '041';
if(!file_exists('study_material/'.$univcode))
{
mkdir('study_material/'.$univcode);
}
$file_resp="";
if ( 0 < $_FILES['file']['error'] )
{
echo 'Error: ' . $_FILES['file']['error'] . '<br>';
$file_resp="Failed to upload file!";
}
else
{
$time = rand(0,100);
$name = $univcode.$time.$_FILES['file']['name'];
$file_name = str_replace($_FILES['file']['name'],$name , $_FILES['file']['name']); //
$path = 'study_material/'.$univcode.'/'.$file_name;
move_uploaded_file($_FILES['file']['tmp_name'], 'study_material/'.$univcode.'/'.$file_name);
}
echo $path;
?>
|