I have 2 content types, Files and Events. Files content type is used to upload files like Image, PDF, Doc etc.

Events content type has a field to attach a document which is uploaded by files content type. The requirement, in event content type I need a field called 'attach files' with maximum five attachment. On click of 'attach files' button, needs to open a page which lists all files uploaded by files content type. On hover of any files an attach button will appear and while clicking it will get attached to the event newly creating event node.

  • Try Entity Reference or something, and then, if you have a problem, ask. Because now it is not clear if you don't know what module to use, how to limit to 5, how to limit to specific node type, or what is your question, exactly.
    – Mołot
    Dec 23, 2014 at 13:15
  • How about the Media module? It can be a bear to configure, but I think it comes close to what you are describing.
    – calebtr
    Dec 24, 2014 at 9:09

2 Answers 2


You can achieve the desired results by implementing the Entity Reference View Widget Module & Entity Reference Module.

  • Is there any function to attach file on click?. I will list all files with views and in the views template, i will add my attach function.
    – drup
    Dec 23, 2014 at 14:49
  • This is the best approach. I used the reference module and form alter codes. Thanks W.M.
    – drup
    Jan 7, 2015 at 4:30

Try the Attachment Links module

The Attachment Links module provides permanent links to files attached to a node. A single, easy-to-remember URL can be used to retrieve the preferred (canonical) or newest version of a file regardless of how many versions of that file have been attached to a node.

Typically, users will want to create a "File" content type and enable the Attachment Links module for that content type. Each "File" node should refer to a single file: "Handbook," "Company logo," "Team roster," etc. Though each node could contain multiple versions of the file, Attachment Link provides permanent link to access the preferred or newest versions.

It seems you can also use the IMCE for FileField module to get the uploaded files from other content type. check this answer posted by me.

  • Thanks for your quick replay. But both the modules didn't met my requirements. I need a file attachment field which links to a file listing page(created with a view). There i need a attach button on every file. A search files option also needed in files listing page.
    – drup
    Dec 23, 2014 at 9:36
  • @drup As far as I know, there is no such module exists in Drupal. So you may have to create your own custom module for this. Dec 23, 2014 at 9:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.