Re: [PHP] fopen/fpassthur

2004-12-14 Thread John Holmes
Sebastian wrote: Q I hope you have some good data validation going on too :) I am not too sure about how secure it is. basically, the files are called by an ID eg, download?type=fileid=3 so i query the db to get check if its a valid id and get the filename from the db as well. if its not found it

[PHP] fopen/fpassthur

2004-12-14 Thread Sebastian
Hi all, I have created a download manger to handle files, when a user clicks a link the file is sent though fopen() and fpassthru() like this: header(Content-type: application/octet-stream); header(Content-disposition: attachment; filename= . $file['filename']); header(Content-transfer-encoding:

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Richard Lynch
Sebastian wrote: Hi all, I have created a download manger to handle files, when a user clicks a link the file is sent though fopen() and fpassthru() like this: fopen() + fpassthru() == http://php.net/readfile is this the most practical way of doing it? i don't want to display file

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Richard Davey
Hello Sebastian, Tuesday, December 14, 2004, 4:19:31 PM, you wrote: S header(Content-type: application/octet-stream); S header(Content-disposition: attachment; filename= . $file['filename']); S header(Content-transfer-encoding: binary); S header(Content-length: . filesize($file['path'] .

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Richard Lynch
Richard Davey wrote: no need to exit() - it's the last line of your script anyway. There was a bug in PHP for a very brief period of time where scripts were not ending under some conditions after all the content was delivered. If one is running that version of PHP, exit; at the end of a script

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Richard Lynch
Sebastian wrote: Q I hope you have some good data validation going on too :) I am not too sure about how secure it is. basically, the files are called by an ID eg, download?type=fileid=3 so i query the db to get check if its a valid id and get the filename from the db as well. if its not

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Sebastian
for me and find any flaws ;) thanks. - Original Message - From: Richard Davey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 14, 2004 12:27 PM Subject: Re: [PHP] fopen/fpassthur Hello Sebastian, Tuesday, December 14, 2004, 4:19:31 PM, you wrote: S header(Content

Re: [PHP] fopen/fpassthur

2004-12-14 Thread Matt M.
Hi all, I have created a download manger to handle files, when a user clicks a link the file is sent though fopen() and fpassthru() you could try http://us3.php.net/readfile -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php