1

This question already has an answer here:

In D6 we have

mysql> describe files;
+-----------+------------------+------+-----+---------+----------------+
| Field     | Type             | Null | Key | Default | Extra          |
+-----------+------------------+------+-----+---------+----------------+
| fid       | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| uid       | int(10) unsigned | NO   | MUL | 0       |                |
| filename  | varchar(255)     | NO   |     |         |                |
| filepath  | varchar(255)     | NO   |     |         |                |
| filemime  | varchar(255)     | NO   |     |         |                |
| filesize  | int(10) unsigned | NO   |     | 0       |                |
| status    | int(11)          | NO   | MUL | 0       |                |
| timestamp | int(10) unsigned | NO   | MUL | 0       |                |
+-----------+------------------+------+-----+---------+----------------+

In D7 we have

mysql> describe file_managed;
+-----------+---------------------+------+-----+-----------+----------------+
| Field     | Type                | Null | Key | Default   | Extra          |
+-----------+---------------------+------+-----+-----------+----------------+
| fid       | int(10) unsigned    | NO   | PRI | NULL      | auto_increment |
| uid       | int(10) unsigned    | NO   | MUL | 0         |                |
| filename  | varchar(255)        | NO   |     |           |                |
| uri       | varchar(255)        | NO   | UNI |           |                |
| filemime  | varchar(255)        | NO   |     |           |                |
| filesize  | bigint(20) unsigned | NO   |     | 0         |                |
| status    | tinyint(4)          | NO   | MUL | 0         |                |
| timestamp | int(10) unsigned    | NO   | MUL | 0         |                |
| type      | varchar(50)         | NO   | MUL | undefined |                |
| uuid      | char(36)            | NO   | MUL |           |                |
+-----------+---------------------+------+-----+-----------+----------------+

Is there a module (or more automated drupal-y way) of associating an uploaded file with an Organic Group [OG]? I need a way to let only group members have access to these uploaded files.

That is, how can I have a field called og_groups and have drupal react to it automatically?

Side note: We're migrating this project from D6 (Commons 2.x) to a plain D7 install base with OG that will decouple the application from Commons 2.x. So a D7 approach would be most appreciated.

marked as duplicate by Krishna Mohan, Mołot, Scott Joudry, Clive May 16 '15 at 9:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.