cant believe txt files are disabled! (but just rename them to .text and you should be ok i guess)
anyway, you can do it like PhpBB do it:
an sqldb with with table "real_name" and "filename", and load the "filename" in php and send it to the user as whatever
real_name is
you can deliver exe/txt files like this:
PHP Code:
<?php
$filename="randomfilename123";
$real_filename="hello_world.exe";
$size = @filesize($filename);
header('Pragma: public');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$real_filename);
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: ' . $size);
$fp = @fopen($filename, 'rb');
if ($fp !== false)
{
while (!feof($fp))
{
echo fread($fp, 8192);
}
fclose($fp);
}
else
{
@readfile($filename);
}
flush();
?>
(reference: PhpBB's download\file.php / function send_file_to_browser() )
edit: live demo here:
http://hanshenrik.tk/transfer_exe_test/
(will download a simple "hello world.exe" console program)
please note however, if the file download takes longer than 10 seconds, it will be canceled.
this can be boosted to 44 seconds by running: ini_set('max_execution_time', 45);
but not longer than 44 seconds, as discussed in this thread: http://www.000webhost.com/forum/customer-assistance/26848-net-err_empty_response-when-running-script-long-time.html#post146713