Sen tarayıcıya dosya içeriğini gönderir sarıcı php dosyası yazabilirsiniz. Ama önce kimse istemeden veya başka tarayıcı üzerinden erişebilirsiniz outside the web root, böylece yüklenen dosyalar saklanır emin olmak gerekir.
Sarıcı php script bu satırlar boyunca bir şey gidebilir:
<?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
?>