[PHP] Hidden File Downloads

2005-04-25 Thread Stuart Nielson
I am trying to setup a script that allows people to upload files for
specific, permissions-based, projects.

i.e.  There are logs that are viewable to clients only after login.  The
admin also has the ability to upload files.  These files should be
associated with a particular log, and then should show up at the bottom
of the log as a link.  Because it's permissions-based, however, the file
should not be a standard ftp/http link pointing to the file, but should
rather be a script that grabs the file, and sends it to the user.

A good example of this is Adobe.  When downloading tryout software from
their site, there is something like this:

http://www.adobe.com/products/tryadobe/thankyou.jsp?
ftpID=2391fileID=2270

Does anybody know how to do this with php?  I'm not sure how to find the
file in the backend and kick it back to the user with the Save As box
popping up.  I'm thinking maybe it has something to do with headers, but
I'm not sure.  Thanks.

Stuart

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Hidden File Downloads

2005-04-25 Thread Pascal Polleunus
Stuart Nielson wrote:
I am trying to setup a script that allows people to upload files for
specific, permissions-based, projects.
i.e.  There are logs that are viewable to clients only after login.  The
admin also has the ability to upload files.  These files should be
associated with a particular log, and then should show up at the bottom
of the log as a link.  Because it's permissions-based, however, the file
should not be a standard ftp/http link pointing to the file, but should
rather be a script that grabs the file, and sends it to the user.
A good example of this is Adobe.  When downloading tryout software from
their site, there is something like this:
http://www.adobe.com/products/tryadobe/thankyou.jsp?
ftpID=2391fileID=2270
Does anybody know how to do this with php?  I'm not sure how to find the
file in the backend and kick it back to the user with the Save As box
popping up.  I'm thinking maybe it has something to do with headers, but
I'm not sure.  Thanks.
Stuart
Hi Stuart,
You should use the function fpassthru.
You'll need to play with the headers, check the user contributed notes 
on http://www.php.net/manual/en/function.fpassthru.php

Cheers,
Pascal
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php