Attach files to posts and pages

This plugin tightly integrates one of the most wanted functions for Cotonti Framework.
Download this plugin for Cotonti Siena.

#1. Features

  • Attach files to pages and forum posts.
  • Does not use PFS.
  • Multiple attachments per post.
  • Size limits set in Cotonti user groups configuration.
  • Thumbnails for attached images.
  • Paper clip button in topic list to show all attachments in topic.
  • Preview image in page category listing for automated showcases.
  • 100% skinnable, internationalization support.
  • Cotonti permissions system used (Read/Write/Admin).
  • Verbose error output.
  • Disk/database cleanup utility.
  • A lot of customizable settings.
  • Personal attachments management.
  • Gmail-like interface support.

#2. Requirements

  1. Cotonti >= 0.0.2
  2. File uploads support on in webserver configuration.

#3. Installation

  1. Put the «attach» plugin into your Cotonti plugins folder.
  2. Log into your Admin panel and install «File Attachments» plugin.
  3. Go to Admin => Configuration => attach and configure the plugin for your needs.
  4. Make sure the directory you specified in configuration is writable for PHP.
  5. Edit your skin files. You can find the list of all available tags on plugin installation page (admin.php?m=plug&a=details&pl=attach).
  6. Don't forget that all the forms in forums.editpost.tpl, forums.newtopic.tpl, forums.posts.tpl, page.add.tpl and page.edit.tpl MUST have an attribute enctype="multipart/form-data".
  7. You can also customize templates in plugins/attach/tpl or you can create your own templates in skins/YOUR_SKIN.
  8. Have fun!

#4. Update

1.Upgrade your site to Cotonti.
2.Reinstall the plugin as described above.
3.Edit your TPLs.

#5. Important details

  • You should run the Clean up tool in Admin => Tools => File Attachments from times to times, because plugin can't automatically remove attachments when whole topics or categories are removed (it does it when single posts or pages are removed). This tool removes attachments which belong to posts which don't exist anymore
  • When you edit a post, there are several options for each upload field:
    • You can change titles only (default).
    • If you want to replace an existing attachment with a new file, you should choose a file by clicking the «Browse» button. Then check the «Replace» checkbox. In this case the previous file will be replaced gently. If you check both «Replace» and «Delete» boxes, this will remove an original file and add a new one, so the cache update is forced.
    • You can delete an existing attachment by checking the «Delete» checkbox.
    • You can add more attachments if there are vacant attachment rows left.
  • Don't forget to set single file size limit and total file space for each user group in Admin => Users => {Target group}.
  • Don't forget to set correct permissions in Admin => Plugins => File Attachments => Rights (admin.php?m=rightsbyitem&ic=plug&io=attach). «R» means viewing and downloading files, «W» means adding your own attachments, «A» means editing attachments owned by others.
  • The Preview image feature for list.php means that the thumbnail of the first image attached to a page will be shown in category listing as a «preview image» which is good for skin shops and other automated showcases.

#6. Known issues

Some custom rewrite corehacks conflict with attachment error message transmission.

#7. Changelog:


  • Ported to Cotonti Siena.


  • Ported to Cotonti, Seditio is no longer supported.
  • The plugin has been made to use its own templates to make things easier.
  • Enhancements in skinability and i18n.


  • Better support for showcase preview images in list (useful for catalogues).
  • Eliminated image XSS possibilities.
  • Fixed a bug with custom attachment titles


  • A few bugfixes.
  • Original filenames added as caption by default.
  • Admin infotool for attachments by ID.


  • User subfolders feature (backwards compatible).
  • Anti-bump conflict fixes.
  • Added «Personal attachments space» management, see the new tags and TPL examples. You may add links to personal attachments in any page/template: plug.php?o=attach&uid=USER_ID.
  • Improvements in attachment control and various fixes.
  • Gmail-like interface support and examples.

1. Boss  2009-07-28 13:42
При закачке файлов ошибка
Fatal error : SQL error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' '', 'png', 1, 45546, 'user_set.png', 0)' at line 2
2. Snake07  2009-07-28 17:41
Не поддерживает tpl-файлы категорий ( и т.п.)
3. Ross  2009-08-24 21:26
If you need the Italian localization of this plugin, you can download it from here:
4. Trustmaster  2010-01-27 15:13
Snake07, поддерживает. Только в админке это невозможно отобразить.
5. Clever  2010-02-16 03:12
После перехода на новый дизайн плагин перестал загружать картинки. Что может быть?
6. Trustmaster  2010-02-17 02:24
Проверить на наличие всего необходимого HTML и TPL-тэгов
7. nextgen  2010-11-08 05:00
Friend could you post the forum edits i need to make please and if time available the PM edits as well.
8. staleo  2013-10-28 13:20

Fatal error

SQL error 42000: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE att_user = 1' at line 1

Did anybody deal with the same?

Only registered users can post new comments