con'td create file download page for firefox using net-transport thru flashGot?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Here is the code

<?php

$filenm = '/var/tmp/';

$s = 1;
$q =2;


switch( $_POST["submit"] )
{
case 's':
$filenm .= 's.tab';
//create $filenm
break;
case 'q':
$filenm .= 'q.tab';
//create $filenm
break;
}


/*
echo "file name = {$filenm}<br>\n";
echo "base name = ", basename($filenm), "<br>\n";
echo "file size = ", filesize($filenm), "<br>\n";
echo "file name = {$filenm}<br>\n";
*/

$sname = basename($filenm);
header("Content-Type: application/octet-stream");
header('Content-Disposition: attachment; filename=' . $sname);
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.filesize($filenm));
readfile($filenm);

unlink($filenm);
?>


Thanks

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux