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.145.84.128
<?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];
// var_dump($new_filename);
// die();
move_uploaded_file($_FILES['file']['tmp_name'], 'uploads/'. $_FILES['file']['name']);
}
if($new_filename){
$arr['err_code'] = 0;
$arr['status'] = 'success';
$arr['casteuploadedfile']= $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;
}
?>
|