我无法在实时服务器上传文件。意味着它确实在我的本地机器中移动,但它不会存储在实时服务器中。数据库条目也已填写,但不会保存。
$authorityLocation="files/authority/";
if(isset($_FILES['Authority'])){
$errors= array();
$file_name = $_FILES['Authority']['name'];
$file_size =$_FILES['Authority']['size'];
$file_tmp =$_FILES['Authority']['tmp_name'];
$file_type=$_FILES['Authority']['type'];
$file_ext=strtolower(end(explode('.',$_FILES['Authority']['name'])));
$expensions= array("docx","doc","pdf");
if(in_array($file_ext,$expensions)=== false){
$errors[]="extension not allowed, please choose a Word or pdf file.";
}
if($file_size > 50097152){
$errors[]='Max File size 50 GB';
}
$date = date_create();
$datetime=date_timestamp_get($date);
$Pan_card = $Pancard;
if (file_exists($authorityLocation."authority ".$Pan_card.$file_name)) {
echo "<!DOCTYPE html>
<html>
<head>
<title>GST</title>
</head>
<body>
<center>
<H3>
Thank You For Your Keen Interest Again!!! You Have Already Submitted The Details.
</H3>
<H4>
Our Team Will Contact You Soon
</H4>
</center>
</body>
</html>";
exit();
} else {
move_uploaded_file($file_tmp, "files/authority/".$Pan_card." authority ".$file_name);
$authorityPath = $authorityLocation.$Pan_card." authority ".$file_name;
}
}