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.144.91.130


Current Path : /proc/thread-self/root/var/www/html/rcub/
Upload File :
Current File : //proc/thread-self/root/var/www/html/rcub/uploadteachlist.php

<?php
//require_once("/Library/WebServer/Documents/oasis/aws/aws-autoloader.php");
require_once("/var/www/html/aws/aws-autoloader.php");
// require_once("C:/XAMPP/htdocs/aws/aws-autoloader.php");
use Aws\S3\S3Client;
use Aws\S3\Exception\S3Exception;


        if ( 0 < $_FILES['file']['error'] ) {
            echo 'Error: ' . $_FILES['file']['error'] . '<br>';
        }
        else {
            $x = $_FILES['file'];
        //  var_dump($_FILES['file']);
            $f_file=explode(".",$x["name"]);
            $new_filename=$f_file[0].".".$f_file[1];
            if($f_file[1] != "pdf"){
                $arr['err_code'] = -2;
                $arr['msg'] = 'PDF Files Only...!';
                echo json_encode($arr);
            return;
            }

            move_uploaded_file($_FILES['file']['tmp_name'], 'upload/'. $_FILES['file']['name']);
        }

        


        if($new_filename){
            $arr['err_code'] = 0;
            $arr['status'] = 'success';
            $arr['teachlistdoc']= $new_filename;
            $arr['msg'] = 'Updated Successfully...!';
            echo json_encode($arr);
            return;
        }else {
            $arr['err_code'] = -1;
            $arr['status'] = 'Failure';
            $arr['msg'] = 'Failed To update';
            echo json_encode($arr); 
            return;     
        
    }
?>