By somebodysysop on
I'm creating a small application in which I want to control permissions to access files.
I can't use a direct link to the file because it can't be publically available on the site (if I am to have control over who can use it).
For a number of reasons, I don't want to use Drupal's default file access (which is essentially the access that the user has to the node that the file is attached to).
So, I need code to be able to output the file to the user's browser if he/she has the appropriate access. Where can I find out how to do that? Thanks!
Comments
In case you won't find
In case you won't find anything better, you can change access permissions on the OS level (in Linux) through these functions:
http://us2.php.net/manual/en/ref.exec.php
(or just ``)
════════════════
Sergata - פיתוח תוכנה
I want to render the file myself.
I guess what I'm asking is how do I render a file? User clicks on link. Link executes function that looks for file, then renders it to browser.
file_transfer
http://api.drupal.org/api/function/file_transfer/6
Used this code (utilizing the Media Manager module for storing files as nodes):