Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Attachments 2.1

edited February 2009 in Vanilla 2.0 - 2.8
I've released a new version with some minor, but useful changes:

Version 2.1 - 20.12.2006, Jazzman
- Removed version check as it isn't really necessary :)
- Added new SaveAsDialog function which allows filenames with spaces
- Fixed a security issue, where discussion attachments could be downloaded by any user (even if you weren't able to view the discussion itself) by just altering the URL and attachment number (Thanks to jaz!)

Download: Attachments 2.1

Upgrade notes: just copy the files over your existing installation.


  • Options
    I noticed on the extension page you linked to it said "This is the core package." So the next version of Vanilla (1.0.4?) will have this included by default will it? Will it still be an extension that can be disabled? Will it be enabled by default?
  • Options
    No, with "core package" I meant that Attachments 2 will be the base extension for uploading files. It can be extended by other addons like Inline Images. However, I haven't had the time to create other addons :P
  • Options
    Ahhhhhhhhhhhh :) Thanks for clearing that up Jazzman :)
  • Options
    I am having the following error message: Fatal error: Only variables can be passed by reference in //nas-001\winspace002.... Not sure what to do. Help appreciated.
  • Options
    Installed this extension and it works well (latest version of Vanilla).

    But how do I configure it to allow for different types of attachment extensions?

    Like I would like to be able to upload an MP3 (a legal one) for my board members to download or even a video clip (yes, legal one again) but it won't allow those type of files to be attached.
  • Options
    same ask as CommentAuthorsunmicroman
  • Options
    doesn't seem to want to play well with friendly urls :(
  • Options

    Go into your default.php and where you see this:
    $Context->Configuration['ATTACHMENTS_ALLOWED_FILETYPES'] = array ( 'image/gif' => array('gif', 'GIF'),That's what you'd edit. Then, its just a matter of testing. I setup my forum to allow .odt, .ods, .xls and .htm/.html

    But, to do that, I needed to first test it by uploading the file I wanted to be able to accept, see what it named the filetype, and then past that into the first section, such as moving my .odt into the octet-stream rather then msword.
  • Options
    Garvin, I don't suppose you'd mind pasting your additional file types in here would you? It would probably save a few people a lot of time and messing around. Perhaps as more of these are found out they could be included in the extension readme for easy copying and pasting? Ideally there would be a GUI for the extension settings where you can just tick a box for a whole plethora of file types...
  • Options
    edited January 2007
    For excel files: 'application/' => array('xls', 'XLS'),
    For Open Office documents and spreadsheets, just tack it onto the octet-stream: 'application/octet-stream' => array('rar', 'RAR', 'doc', 'DOC', 'ods', 'ODS', 'odt', 'ODT', 'ttf', 'TTF'),
    This one was for HTML. However, it currently doesn't work: 'application/text/html' => array('html', 'HTML', 'htm', 'HTM', 'xml', 'XML') I'm not sure what I should be putting in there for text/html. I tried just text. I tried just html. I tried text/html. Nothing. So, maybe someone smart can post it in here?
  • Options
    edited January 2007
    Thanks for that Garvin :) I had a real "DUH" moment when I read the open office documents line, because of course they are just ZIP files with a bunch of XML etc files inside them ;)

    Is there not a way to write a single extension in the array and make it case insensitive?
  • Options
    I'm not familiar enough to know what would need to be done. What I'd like to see, still, is multiple extensions. My clients were really enjoying the whole 10 attachments limit. It makes it more time consuming when they have to post a new comment per attachment. Anyone know how I can put this into my default? Or should I wait for Jazzman to make it available in 2.2? If he is even considering it (which I hope he is).
  • Options
    I keep getting the errors like this: Notice: Trying to get property of non-object in /forums/library/Vanilla/Vanilla.Control.CommentGrid.php on line 85 Notice: Trying to get property of non-object in /forums/comments.php on line 42 But on several different lines. Please help, thanks. (I'm sure this is a great extension, but I wish it would work!)
  • Options
    I found this weird problem with Attachments enabled. If I tried to post or edit a post and I went over the character limit rather than giving me an error related to it it gave the non-object found error as if the topic I was posting under didn't exist. I found this out by disabling the attachment extension and then it gave me the 548 characters above the limit error. After I upped the character limit it worked fine. I just thought I'd post this and hopefully someone can figure what's going wrong.
  • Options
    I agree with robbgrassroots! I've just discovered the same problem, this wrong error is confusing my users...
  • Options
    Thank you sir.
  • Options
    Hi All

    I am new to Vanilla and trying to get Attachments 2.1 and inline images working on Vanilla 1.0.3
    Have set permissions for upload folder on server to read and write but still no joy.
    Can anyone talk me through the installation. I am with MediaTemple as a server.

    At present it sees the file when I select it on the add topic window but when I click add comment it seems to not be able to find or load the attachment adn it does not show in the bulletin board.

    Thanks for any help.
    You can email me direct at;
  • Options
    edited January 2007
    I try to add an exception code in default.php, it seems solve non-object error, just change $AttachmentManager->DiscussionID = $Discussion->DiscussionID; $AttachmentManager->Comment = &$Discussion->Comment; $AttachmentManager->SaveAttachments(); to if(isset($Discussion->DiscussionID)){ $AttachmentManager->DiscussionID = $Discussion->DiscussionID; $AttachmentManager->Comment = &$Discussion->Comment; $AttachmentManager->SaveAttachments(); }

    But i think it may be have some better fix.
    BTW, thank you, Jazzman.
Sign In or Register to comment.