Upload: collaborate with files

Last modified: November 9, 2009 - 02:41

The upload core module allows users to upload files to the site. The ability to upload files to a site is important for members of a community who want to share work. It is also useful to administrators who want to keep uploaded files connected to a node or page.

Users with the upload files permission can upload attachments. You can choose which post types can take attachments on the content types settings page. Each user role can be customized for the file size of uploads, and the dimension of image files. Note: you must first give a user role upload permissions before you can customize some of these settings.

You can

  • enable/disable uploads for individual content types at administer >> content management >> content types.
  • administer storage location of uploaded files at administer >> site configuration >> file system
  • configure file size, file extensions, and other user role defaults at site configuration >> file uploads.
  • control who can upload and view attached files at administer >> user management >> permissions.

The maximum upload size is controlled by your PHP environment. The standard PHP default is 2 MB. If you need to alter this, see the handbook page on how to Increase upload size in your php.ini.

Modifying Private Files

NOTE: If you have private download method enabled:
Administer > Site Configuration > File System > Download Method: Private

Do NOT modify uploaded files outside of Drupal. When you upload a file as an attachment to content, Drupal stores the file size in the database and it is used to generate the header information when it is downloaded. The ONLY way you should modify a file is to delete the attachment and upload the new file.

Files and Revisions

The upload module does not handle file revisions in the sense of the Microsoft Word "track changes" feature. However, if you attach a new version of a file with the same file name to a node, Drupal will automatically modify the filename to avoid conflicts on the filesystem. You then have the option of un-checking the "List" checkbox for the previously attached file.

For more information, check the File Management category of contributed modules.

If you can't upload

miriamnz - July 7, 2009 - 10:19

In order for Drupal to upload you need the permissions to be set to be writable on the server directories. You need Drupal to access the tmp file. Some shared server setups have that already configured, others require a modification to the php.ini file in order for Drupal to know where the tmp file is.

Here's the php.ini code that worked for me:

file_uploads = On
upload_tmp_dir = /home/username/tmp

Check out these issue here for more: http://drupal.org/node/#509230 and http://drupal.org/node/#511394

Another problem that has arisen preventing upload working is having the allowed upload size set in the php.ini as 2MB, when the php.ini file can only understand 2M (meaning 2 MB).

Miriam
Otaki, New Zealand

 
 

Drupal is a registered trademark of Dries Buytaert.