The fastest and easiest thing is to make the material with a small Drupal module that you do for this case, instead of sending a lot of messages to the server and wasting resources on loading the node and what not.
Anyway, what you need for this is very similar to what the mac answers here :
file_field, cck, , node. , , node.
db , , , drupal, Drupal api. API- drupal , db_set_active()