The first bug which i see from the code is this:
PHP Code: 
$post '&pass=~something~';
    
$post '&file='.$_FILES['file'];
    
$post '&subject'.$_POST['subject'];
    
$post '&year'.$_POST['year']; 
  • Assignment Operator
  • &year and &subject needs to have "=" after them

So those lines in your code to something like this and it should work:
PHP Code: 
$post = array(
   
'file' => '@' $_FILES['file']['tmp_name'],
   
'subject' => $_POST['subject'],
   
'year' => $_POST['year']
 );