You can use simple php script. This script returing inputet in GET file on the brower.
After his excecution you can rename this file to random string.
this only first person download this file.
Your link get somethis like this. www.domain.tld/dir/script.php?file=./usr/123.tar.gz.
You can filename encrypt in base64 too, in this option your link is www.domain.tld/dir/script.php?file=Li91c3IvMTIzLnRhci5neg==
Script without base64:
<?php
$file = $_GET['file'];
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
rename($file, "secret_new_filename");
exit;
}
else
{
echo 'File don\'t exist';
}
?>
And with base64:
<?php
$file = base64_decode($_GET['file']);
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
rename($file, "secret_new_filename");
exit;
}
else
{
echo 'File don\'t exist';
}
?>