无法在PHP中上载文件

无法在PHP中上载文件,php,forms,Php,Forms,我无法在live server中上载文件。这意味着它确实在我的本地计算机中移动,但不会存储在实时服务器中。数据库条目也已填充,但不会保存 $authorityLocation="files/authority/"; if(isset($_FILES['Authority'])){ $errors= array(); $file_name = $_FILES['Authority']['name']; $file_size =$_FILES['Authority

我无法在live server中上载文件。这意味着它确实在我的本地计算机中移动,但不会存储在实时服务器中。数据库条目也已填充,但不会保存

$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;

}

}
$authorityLocation=“files/authority/”;
如果(isset($\u文件['Authority'])){
$errors=array();
$file\u name=$\u FILES['Authority']['name'];
$file\u size=$\u FILES['Authority']['size'];
$file\u tmp=$\u FILES['Authority']['tmp\u name'];
$file\u type=$\u FILES['Authority']['type'];
$file_ext=strtolower(end(分解('.',$文件['Authority']['name']));
$expensions=数组(“docx”、“doc”、“pdf”);
if(在数组中($file\u ext,$expensions)==false){
$errors[]=“不允许扩展名,请选择Word或pdf文件。”;
}
如果($file_size>50097152){
$errors[]=“最大文件大小50 GB”;
}
$date=date_create();
$datetime=date\u timestamp\u get($date);
$panu card=$Pancard;
如果(文件存在($authorityLocation.“authority”。$Pan_card.$file_name)){
回声“
消费税
再次感谢您的浓厚兴趣!!!您已经提交了详细信息。
我们的团队将很快与您联系
";
退出();
}否则{
移动上传的文件($file\u tmp,“文件/权限/”$Pan\u card。“权限”。$file\u名称);
$authorityPath=$authorityLocation.$Pan_card.“authority”。$file_name;
}
}

检查“live”服务器上目标文件夹的权限。PHP代码不是以根用户身份运行的-因此您必须为运行PHP的用户(通常为“apache”)授予写入权限。可能您正在写入的@Nosyara文件夹受写保护。您需要检查位置
$authorityLocation
是否可写,您的live server是否已打开以进行文件上载。这是一个权限问题。非常非常感谢请阅读-总结是,这不是一个理想的方式来解决志愿者,可能会适得其反获得答案。请不要将此添加到您的问题中。