Managing permitted uploaded document file types and sizes

Attachment types

As distributed Drupal Commons limits the file types of files that can be uploaded as attachments to the Document content type.  The default permitted types include:

jpg, jpeg, gif, png, doc, docx, txt, xls, xlsx, pdf, ppt, pps, odt, ods, odp, tar, gz, tgz, zip

You can modify this list to add, or remove additional file types (as defined by the extension of the filename).  This involves changing some field attributes of the Document content type as follows:

  • Visit /admin/content/node-type/document/fields/field_file on your site
  • Modify the Permitted upload file extensions field to add, or delete file extensions
  • Save the page (field settings)

Attachment sizes

Permitted attachment sizes are actually controlled by two independent settings. You will likely need to adjust both.

  • You must adjust the setting in your php.ini file. See this page on drupal.org for more detailed information
  • Drupal also independently (and subsequent to PHP's limit enforcement) enforces its own limits on uploaded file size. To adjust this for Drupal 6-based sites (which is what Commons runs on as of the initial version of this page (27 Sept 2010) visit "Administer » Site configuration » File uploads" ( /admin/settings/uploads ). The Drupal settings cannot be larger than those permitted by PHP, but may be smaller if you haven't updated them, so remember to check there after updating php.ini.