I would go for the 3rd alternative. There are several ways to "stream" the file with the use of headers.
This way you can validate the user securely with your logon system, and you can place the files outside the viewable web content. Typically oputside your www / public_html folder. I use this myself in an application I use, streaming files at 50MB does not use alot of resources at all, atleast not the way I use. My use for the script is to serve high resolution images to several customers, often TIF images up to 50MB and larger. Heres the code I use : $distribution= "filepathonserver"; if ($fd = fopen ($distribution, "r")){ $size=filesize($distribution); $fname = basename ($distribution); header("Pragma: "); header("Cache-Control: "); header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"".$fname."\""); header("Content-length: $size"); while(!feof($fd)) { $buffer = fread($fd, 2048); print $buffer; } fclose ($fd); exit; } -- Kim Steinhaug --------------------------------------------------------------- There are 10 types of people when it comes to binary numbers: those who understand them, and those who don't. --------------------------------------------------------------- "Apz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 30 Dec 2003, news.php.net wrote: > > Creating unique symlinks would be easier but my development machine is > > Windows and my server is FreeBSD and I can't create file links under > > Windows. Plus, my FreeBSD server is not near me so remote development is > > difficult. > > 1) windows has symlinks since win2000, however they are named Junctions. > I would recommend visiting sysinternals.com and getting junctions > tool (win2k/xp/2k3 -> miscalenous). Hey, it even comes with source! > > 2) another way is to make a redirect, so you do: > getFile.php?file=something.zip > > and in your code you do: > <? > include "_mylibs.php" > if (userLoggedIn()) > header "Location: ".$_REQUEST["file"]; > else > echo "Only Valid People Can Login"; > ?> > > 3) final way is to pass through the file yourself. Safest way, but > potentially more resource hungry than the two above > in your code you do: > > > <? > include "_mylibs.php" > if (userLoggedIn()) > { > header("Content-type: application/octet-stream"); > header("Content-Disposition: attachment; ". > "filename=".$_REQUEST["file"]); > readfile($_REQUEST["file"]); > } > else > echo "Only Valid People Can Login"; > ?> > > > > recommended reads: > http://www.php.net/manual/en/function.header.php > > further recommended things to checkout: > freshmeat , and search for anti leecher scripts. > > > > /apz, bringing joy to the world.... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php