Attachment Improvements By Xon

Attachment Improvements By Xon 2.2.0

No permission to download
Compatible XF 2.x versions
  1. 2.0
  2. 2.1
Additional requirements
php 5.6+
Optionally; Nginx (for X-Accel-Redirect support)
License
MIT Licence
A collection of improvements to XF's attachment system.
  • Option to strip jpeg EXIF data
  • SVG support
  • Nginx's X-Accel-Redirect
  • New Permissions for forum/conversations (Respects global attachment size & count limits):
    • Attachment Size (kb).
    • Maximum Attachment Count.
  • Adds support for video stream via partial content requests

SVG Support
Support for SVG attachments to be displayable as normal images.

Nginx X-Accel-Redirect (OPTIONAL)

Enables the use of Nginx's X-Accel-Redirect header feature for attachment serving.

This permits XenForo to-do validation and authentication, and offload the actual file serving to Nginx. This feature is not particularly well documented, but some info found here.

After following Using DigitalOcean Spaces or Amazon S3 for file storage in XF 2.x attachments no longer show, you must follow the relevant FAQ entry!

This addon assumes the /internal_data folder exists within the webroot, and you do not have a 'deny all;' statement but instead use 'internal;' to secure the internal_data folder.

For example, XenForo is accessible from: /forum rather than then the webroot.

The following must be added to config.php:
Code:
$config['internalDataUrl'] = '/forum/internal_data';

Something similar to the nginx config may be required in your webserver:
Code:
location ^~ /forum/internal_data {
  internal;
  add_header Etag $upstream_http_etag;
  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;
  alias /path/to/internal_data;
}

To ensure you match how XenForo serves files, add the following headers into your website config for the internal_data folder:
Code:
  add_header Etag $upstream_http_etag;
  add_header X-Frame-Options SAMEORIGIN;
  add_header X-Content-Type-Options nosniff;

New Permissions

Permits per-forum or conversation attachment size and count limits.

Respects the global forum wide attachment size/count limits, with per-usergroup settings allowing smaller values.

Due to how XF integer permissions work, 'unlimited' or '0' evaluate as no permission being set.

Post Install Instructions
Add 'svg' file extension to the list of supported to allow svg files to be uploaded.

Contributing features or bug fixes
Please create a Github Pull request via the "More Information" link.

Contributions

If you appreciate this add-on, please consider a contribution via PayPal. Details will be provide via private conversation.

Please contact me if you wish for different licencing arrangements.
Author
Xon
Downloads
187
Views
3,996
First release
Last update
Rating
5.00 star(s) 4 ratings

More resources from Xon

Latest updates

  1. 2.2.0 - Feature update

    Fix XFMG support (ie content stored in data rather than internal_data) Support for video stream...
  2. 2.1.0 - Bugfix update & XF version requirement change

    Require XF2.1+, remove XF2.0 support Fix "Call to a member function save() on null" when handing...
  3. 2.0.9 - Bugfix update

    Fix "Error: Call to a member function save() on null" when handling Jpeg's without exif...

Latest reviews

A very useful addon, we can tempt people to user upgrades by offering more attachments per post. Thanks again xon for a great addon!
A very useful feature for large forums is X-Accel-Redirect. Which allows you to solve the problem of the forum, which puts all the work on php, but thanks to this function, you can transfer it to the nginx web server.
Hands down one of the best and most essential XenForo addons if you're planning on making use out of the attachment system. Xon is a very patient developer who made this addon possible, and we're using it on our attachment-centric forum (over 100,000+ files) without any issues whatsoever. If you want your users to be able to stream video files, this is the addon that you want and need!
Works a treat, needed this for EXIF data-stripping. Haven't used the Nginx Accel-Redirect feature yet.
Top