Re: [PHP] file access(mpeg) only for authenticated people

2001-03-07 Thread Thorsten Gutermuth
hi! I'm having some trouble with this. If i use an ftp address out of some reason I'm unable to read the file(although I get a handle).(ftp server supports passive mode) And if I use http(without authorisation) the browser still asks if I want to save it.(even if I use video/mpeg as Content-Type)

Re: [PHP] file access(mpeg) only for authenticated people

2001-03-07 Thread Mukul Sabharwal
Hey, Well sure there is: $fp = fopen($filename, 'r') or die('damn'); $read = fread($fp, filesize($filename)) or die('damn'); $filestr = basename($filename); header("Content-Disposition: attachment; filename=$filestr"); header("Content-Type: application/octet-stream"); echo $read; exit; Neat A

[PHP] file access(mpeg) only for authenticated people

2001-03-07 Thread Thorsten Gutermuth
Hi! I'm trying to make some mpegs available only to people who authenticated themselves using php. But all the solutions I found somewhat unpleasant because I uses chmod to set the file attributes to u=rw and then used either i) readfile("ftp://name:password@server/path//test.mpeg"); or ii) head