You can write a wrapper php file that sends the file content to the browser. But first you have to make sure that your uploaded files are stored outside the web root so that no one can access them via browser, unintentionally or otherwise.
The wrapper php script can go something along these lines:
<?php
$f = $_GET[ "f" ];
if ( filename_is_ok( $f ) && is_file( "../some_folder_outside_www/$f" ) )
{
header( "Content-Type: text/plain" );
header( "Content-Disposition: attachment; filename=$f" );
header( "Content-Length: " . filesize( "../some_folder_outside_www/$f" ) );
readfile( "../some_folder_outside_www/$f" );
}
else
{
header("HTTP/1.0 404 Not Found");
echo "File not found (or you're not supposed to view this file)";
}
function filename_is_ok( $f )
{
// You'll have to implement it yourself
return false;
}
// example calls:
// http://website.com/download.php?f=test.php
// http://website.com/download.php?f=test.js
?>