如何安全地在服务器上存储sql dbs [关闭]

I have an android app with few sql dbs. I am providing a backup and restore functionality in my app. So when the user selects backup the sql db files are sent to a server and on restore the sql db files are fetched from the server and restored in device. The thing is I am not sure is there any particular way in which I should store the files on the server, because as of now anyone with a link will be able to access those files, I am using a simple php script on the server :

<?php

  $file_path = "uploads/";

  $file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
  if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
    echo "success";
  } else{
    echo "fail";
  }

?>

Can anyone please guide me the approach to follow to achieve the desired result.

Thanks.

Well, you don't have to move the uploaded file into any public directory. When a user wants to restore his backup, he should access a php file that gets his backup file and sends to him.

backup.php

$file_path = "../uploads/";

$file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
    echo "success";
} else{
    echo "fail";
}

restore.php

$filePath = "../uploads/some_uploaded_db.sqlite";
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($filePath));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($filePath));
ob_clean();
flush();
readfile($filePath);
exit();