Drupal 7:如何将分类术语与上传的文件相关联

How to associate a taxonomy term to an uploaded file with drupal 7 ? For example I add a node with a file type field, and upload a file then i try to associate a taxonomy term to the uploaded file.

Thanks

You can't attach a taxonomy term to a field, it's against the Drupal data structure. You can :

  • attach a term to your node, adding a term reference field beside your file field,

  • create a content type holding your file field, a term reference field, and an entity reference field pointing on to your regular nodes (i.e creating a separate content type for your file field + the term reference, and set up a relation between your regular nodes and this content type). Best solution in my opinion : if you need to attach terms to your files, then they deserve a content type.

You will need Entity Reference module for the second solution. Views allows you to grab related content ("Relationships" in advanced tab) when displaying the regular nodes.