Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Attachments 2.1

edited February 2009 in Vanilla 2.0 - 2.3
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.


  • 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?
  • 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
  • Ahhhhhhhhhhhh :) Thanks for clearing that up Jazzman :)
  • 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.
  • 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.
  • same ask as CommentAuthorsunmicroman
  • doesn't seem to want to play well with friendly urls :(
  • @sunmicroman

    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.
  • 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...
  • 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?
  • [-Stash-][-Stash-]
    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?
  • 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).
  • 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!)
  • 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.
  • I agree with robbgrassroots! I've just discovered the same problem, this wrong error is confusing my users...
  • 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; [email protected]
  • 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.
  • I just tried to install Attachemnts 2.0 and added my upload path to default.php and changed the file permissions to write. However, I am still reciving this message.

    Some problems were encountered
    An error occured while creating a new attachment folder. Check your upload path permissions

    I have tired various file permission settings 777, 755 etc.. but it still does not work can someone please let me know the correct permission settings.
  • Attachments 2 creates it's own subfolders in your upload path. If you can't create new folders, you can change the upload path setting from the settings tab:
  • edited January 2007
    I still can't seem to get this extension to work. I am getting a safe mode restriction warnning. Are there any confilcts with other extensions and/or can you give me quick step by step instructions?

    Do you need to edit lines in the default.php file?
  • No, you only need to edit the default.php if you want to change allowed filetypes. And there are no step by step instructions... It should work out of the box. Dunno about the safe mode restriction warnings though.. What messages are you getting? Maybe you can provide a link to your forum?
  • Thanks for the string, but I cannot imagine that everyone is understanding this, so I'll be the sacrificial calf...

    I'm also having the "Trying to get property of non-object in" errors. Am I to understand from above that it's because the filetypes are unknown?

    You talked about fyle types:
    'application/octet-stream' => array('rar', 'RAR', 'doc', 'DOC', 'ods', 'ODS', 'odt', 'ODT', 'ttf', 'TTF')

    Is there a list yet of ALL fyle types, or at-least popular ones?

    I think we can all figure-out the array portion, but I'm clueless what to use on the application portion.

    It might be the only ones missing are common audio/video types. All I need are MP3 and WAV for now, but if anyone has this already built, we would greatly appreciate it!

    I pulled these from my copy of SoundForge:

    MainConcept MPEG-1: mpg, mpeg, mmv
    MainConcept MPEG-2: mpg, mpeg, m2t
    MP3 Audio: mp3
    NeXT/Sun (Java): au, snd
    OggVorbis: ogg
    Quick Time: mov, qt, dv
    Sony Perfect Clarity Audio: pca
    Video for Windows: avi
    Wave (Microsoft): wav
    Windows Media Audio: wma
    Windows Media Video: wmv
  • edited January 2007
    if this is buried because it's been answered a kajillion times, then can someone please point me where to go?

  • Ditto the interest in mp3 support.

    Also, I can't seem to get this up and running. I've installed and enabled, attached an item (word doc) but the file doesn't appear. Attachments table has been created, as has the path, but no upload... Help, anyone?
  • You sure you got the file permissions on the upload path OK?
  • Also,
  • Hey Minisweeper - I set file permissions to the destination folder as 777...

    @Stash - that's good to know. Only problem is uploads don't seem to be working for me at all? I tried with a .doc (that should work out of the box, right?) - no error message, no file in upload path, no entry in database...

    I bet it's something simple. (Or rather, I hope it's something simple... ;)
Sign In or Register to comment.