Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Attachments in v1pre3

I've just installed v1pre1. Installing the attachments extension seems to work fine: both my old pre-upgrade and newly made attachments show up nicely. But when I try to download the files i get corrupted files. The files I save using the browser also has the wrong names (only the first word, and no .doc) I have verified that the files in the uploads folder are intact. Any ideas what could be wrong here?

Comments

  • ...also, the thumbnailing doesn't work: the image is displayed as is instead.
  • Are you, by any chance, using Friendly URLs?
  • I enabled them, but took them away because of a database error. So no.
  • See how it looks here: http://www.tools.web.surftown.se/storaa/forum/comments.php?DiscussionID=2&page=1
  • same problem for me. The document is still fine on the server. But the one downloaded is blank.
  • Glad to hear its not only me =)
  • Sorry Thomas, my problem is different. A_magical_him guess it wright, it is a problem with friendly url. With Friendly Urls off I can download an attached doc.
  • Okey! I'll need to experiment a bit more with this. But all your troubles are fixed now, right?
  • this is the link to download file.doc: comments.php?CommentID=14&&Download=file.doc
    with friendly urls on the link is discussion/14/&Download=file.doc --> comments.php?CommentID=14&Download=file.doc

    too late to think to that now...
  • Actually, with friendly urls the link is discussion/14/?&Download=file.doc --> comments.php?DiscussionID=14&Download=file.doc. To fix it on my test forum, I modified the extension to properly integrate with friendly urls.
  • I've now tried entering the url of a file both with and without double '&'. No luck either way, just blank downloads =(
  • yeah it need two &. What the the second & is for?
  • edited June 2006
    nvm
  • edited June 2006
    Have you tried this fix (//edit: sorry, I read your post to fast, this fix can't do anything with with this problem)

    Here the problem is just that the friendly link to donwload file.doc should be "discussion/##/?&&Download=file.doc" and not "discussion/##/?&Download=file.doc".

    "discussion/##/" is not a problem since this rule in .htaccess, "RewriteRule ^discussion/([0-9]+)/$ comments.php?DiscussionID=$1 [QSA,L]" transform "discussion/##/" in "comments.php?DiscussionID=##".
  • edited June 2006
    Oups read the post of the magical one quick too... the rewrite rule is the problem. To download the file you need CommentID=## and not DiscussionID=##.

    I believe a quick fix would be to edit the line 329 of /extensions/Attachments/default.php; replace:
    $AttachString .= '<a href="' . GetUrl($Context->Configuration, 'comments.php', '', 'CommentID', $CommentID, '', '&Download='. urlencode($FileName)) .'">'. $FileName .'</a>';
    $AttachString .= '<a href="' . $Configuration['BASE_URL] . 'comments.php?CommentID=' . $CommentID . '&Download='. urlencode($FileName) .'">'. $FileName .'</a>';
  • On my forum the extension is weird indeed. Some old attachments (v1pre1) come up in a messed up fashion. The new attachments show up only with a few random characters, mainly square boxes. Odd stuff! And it seems it only happens on my v1pre3 forum?
  • Aha! Setting the forum to English makes the extension work. I realised this when toying with the new GuestSignIn extension (http://lussumo.com/community/discussion/2530/log-in-from-front-discussions-page/#Comment_31844). Is this a more generam problem with V1pre3 and languages/add-ons?
  • Hurra! Problem solved! There were errors in the language file. See http://lussumo.com/community/discussion/2452/swedish-translation/#Item_12 for the specs.
  • Sorry guys!
  • No worries bjrn ;-) I should have realised it was the language setting. Anyhow I'm very grateful for the translation! And the rest of the lot have perhaps learnt a thing or two!
This discussion has been closed.