Drupal - Mixed public/private file upload

What you want is to build a custom widget for the file field type, that has a checkbox that says "this file should be private". Drupal 7 natively handles per-file public/private upload, so at this point it is nothing more then a UI issue.

It has been stated that Private Upload will not be ported to Drupal 7, but I think this is wrong. It should be ported and provide two features:

  • An upgrade path from the custom, hackish, storage of private files in Private Upload to proper private files (this is not going to happen by magic)
  • A custom widget that allows the user to choose between public and private during upload

With OG, I have created my own switch by using file_field_paths and entering [node:group_content_access]/[node:nid] as the path to store files. In my case every node published should be in an OG. Depending on the visibility of the node published, the files are put into a public or private section.

Note however, that this heavily depends on the contents of the group_content_access or Group Visibility field.

Tags:

Files

7