Quicklinks


Allowing file attachments to nodes

File attachments in nodes can allow normal users to post far more rich content that text-only has to offer. A site with numerous content-types and downloads ensures more return visits and general browsing pleasure, not to mention posting fun. I personally love file-attachments, as it allows for a fairly simple method of uploading images to posts, which older versions of Drupal lacked in core.

For attachments to work, there's a few things you need to check (you will need to be logged in, with administrator permissions):

Step 1: Make sure Drupal can accept uploaded files
The Drupal interface allows you to specify a place where all uploaded files will be placed on the server. You can find that setting here:

Home » administer » settings

Scroll down to the section named "File System Settings" and give the "File system path" a value of your choice (default is "files" without the quotes).

Note: You will have to create the folder on the server manually, and make sure the folder permissions allow Drupal to write there. If these are not correct, Drupal will display an error message.

Set the "Download Method" to public and submit your changes.

Step 2: Setup the default workflow
The default workflow can be found here:

Home » administer » content » configure » default workflow

You should see a list of node types currently activated in your Drupal site. Check all the boxes under "attachments" for all the node types you wish attachments to enabled and submit your changes.

Step 3: Setup the rules for attachments
Once Steps 1 and 2 are completed, additional menu items will be available from the navigation menu. Setup the attachment rules from here:

Home » administer » uploads

Fill out the whole form according to your site/users needs and submit your changes.

Note: Keep the filesize limitations low for live sites. Large up and downloads eats bandwidth and is precious. For intranets, limitations can be far more leniant.

Step 4: Set the user permissions
Only users with the correct user permissions can upload files to their own nodes. You can setup the user permissions from here:

Home » administer » users » configure » permissions

You should see a table of User Roles and Permissions (per module activated). Under the "upload module" section, check all the boxes for the roles you wish to allow to upload files and submit your changes.

Note: User roles is a very handy method of setting up different user types responsible for different sections or content-types for your Drupal site. Read more on User Roles under "User Roles" (coming soon)

Users can now safely upload files, or include images to their nodes