Fork me on GitHub
Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

FileUpload 1.1 Released

13»

Comments

  • TimTim Lord of Servers Vanilla Staff
    Today I'm fixing this plugin. Look for an update in the next 8 hrs.

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • if anyone wants to actually display the uploaded images along with the comments, instead of just presenting download links, you can replace plugins/FileUpload/views/link_files.php with this:<div class="Attachments">
    <div class="AttachmentHeader">Attachments</div>
    <table class="AttachFileContainer">
    <?php
    foreach ($this->CommentMediaList as $Media) {
    if (strpos($Media->Type, 'image/') !== FALSE) {
    ?>
    <tr>
    <td colspan="3"><img src="<?php echo Url('/uploads').'/'.$Media->Path; ?>"/></p>
    </tr>
    <?php
    } else {
    ?>
    <tr>
    <td><img src="<?php echo $this->GetWebResource('images/gear.png'); ?>"/></td>
    <td><a href="<?php echo Url("/discussion/download/{$Media->MediaID}/{$Media->Name}"); ?>"><?php echo $Media->Name; ?></a></td>
    <td>(<?php echo Gdn_Format::Bytes($Media->Size, 0); ?>)</td>
    </tr>
    <?php
    }
    }
    ?>
    </table>
    </div>

    Just tweak the HTML and your theme to your liking. I got rid of the whole "Attachments" heading in mine.
    Beautiful solution, thanks very much! Any idea on how to make sure that this is constrained to the max size of the column for larger images?
  • You can use the Image Resizer addon, but I think it will need some tweaking to match the DOM structure of attached images. I'll take a look at it.

    The other alternative is to wait for the next release of FileUpload. Tim's said he's building this functionality into the addon and I'm sure it will be a lot nicer than my hack.
  • Another solution to the image viewing problem is to display the url of the image uploaded and use the magic plugin. will have to make this plugin be processed prior to magic but it might work.
  • The README file says "INSTALL PECL APC (Alternative PHP Cache)"
    Well, in order to install this, you must have your website hosted on a dedicated server because you have to use Secure Shell (SSH) access
  • However TiGR's second issue is valid and happens in Firefox as well. The issue appears to be that, when editing a post, you have multiple DIVs on the page with the same ID ('CurrentUploader'), and each of those divs is matched by the selector in fileupload.js line 12, so they each receive the html append on line 121.

    these guys just need unique IDs.
    This is the exact same problem I'm having. How can I give them unique IDs?
  • i believe that problem has been fixed in newer versions of vanilla. what version are you running?
  • TimTim Lord of Servers Vanilla Staff
    That's the latest version. This issue has not been fixed in any stable release yet.

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • @jaseyboy you could put in

    < width=100%/>
    in the img-code - then the image will at least not be broader than the blue border.

    It doesn't work with MaxImageSize-plugin for me.

    @ruifelipe thanks, your changes work well for me!

    @Tim I can't yet use my locale.php with this plugin but have to customize it in the plugin's files themselves. Maybe that's something else to improve for the next version?
  • TimTim Lord of Servers Vanilla Staff
    @basb good point, I just did that.

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • Is there a definite way to attach an image to your comment using thickbox or similar
  • Ive issue with version 1.1. I'm using vanilla forum version 2.0.9. this is the scenario

    1. type in my comments then attach a file, attach file successful.
    2. When i want to post my comment, after posted the comment the attached file does not upload. It did not store into the database. even those old uploaded files doesn't work either. I cant download old files. When i go to /discussion/download/'mediaid'/filename, it seems to be blank page....no download popup windows at all.

    Help....in trouble now :(
  • I'm using rc3, which is the only version of Vanilla I was able to get working on my server. I receive the following error when trying to install the latest version of FileUpload:

    FATAL ERROR IN: PHP.Gdn_ErrorHandler();

    "FileUpload requires the Vanilla application version 2.0.9"
    LOCATION: D:\Inetpub\sarahsinn\tap\library\core\functions.general.php
    > 364: );
    > 365: }
    > 366: }
    > 367: } else if ($RequiredVersion != '*' && $RequiredVersion != '') {
    >>> 368: throw new Exception(
    > 369: sprintf(
    > 370: T('%1$s requires the %2$s %3$s version %4$s'),
    > 371: $ItemName,
    > 372: $RequiredItemName,
    BACKTRACE:
    [D:\Inetpub\sarahsinn\tap\library\core\class.pluginmanager.php 413] PHP::CheckRequirements();
    [D:\Inetpub\sarahsinn\tap\applications\dashboard\controllers\class.settingscontroller.php 499] Gdn_PluginManager->TestPlugin();
    [D:\Inetpub\sarahsinn\tap\library\core\class.dispatcher.php 270] SettingsController->TestAddon();
    [D:\Inetpub\sarahsinn\tap\index.php 39] Gdn_Dispatcher->Dispatch();

    I attempted to change the version number to 2.0.9 in the index.php file, but this didn't seem to have any effect whatsoever. Am I using an incompatible version of vanilla? I never really understood what the rc versions were anyway.

    Thanks,
    Chris

  • So, I installed PHP-APC using apt-get on my ubuntu server, but I still do not get my realtime progress bars. What could possibly be the issue?
  • TimTim Lord of Servers Vanilla Staff
    FileUpload 1.1 is old, would you mind continuing your discussion in the new release thread? I'll answer your question there.

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • TimTim Lord of Servers Vanilla Staff
    I'm using rc3, which is the only version of Vanilla I was able to get working on my server. I receive the following error when trying to install the latest version of FileUpload:

    FATAL ERROR IN: PHP.Gdn_ErrorHandler();

    "FileUpload requires the Vanilla application version 2.0.9"
    LOCATION: D:\Inetpub\sarahsinn\tap\library\core\functions.general.php
    > 364: );
    > 365: }
    > 366: }
    > 367: } else if ($RequiredVersion != '*' && $RequiredVersion != '') {
    >>> 368: throw new Exception(
    > 369: sprintf(
    > 370: T('%1$s requires the %2$s %3$s version %4$s'),
    > 371: $ItemName,
    > 372: $RequiredItemName,
    BACKTRACE:
    [D:\Inetpub\sarahsinn\tap\library\core\class.pluginmanager.php 413] PHP::CheckRequirements();
    [D:\Inetpub\sarahsinn\tap\applications\dashboard\controllers\class.settingscontroller.php 499] Gdn_PluginManager->TestPlugin();
    [D:\Inetpub\sarahsinn\tap\library\core\class.dispatcher.php 270] SettingsController->TestAddon();
    [D:\Inetpub\sarahsinn\tap\index.php 39] Gdn_Dispatcher->Dispatch();

    I attempted to change the version number to 2.0.9 in the index.php file, but this didn't seem to have any effect whatsoever. Am I using an incompatible version of vanilla? I never really understood what the rc versions were anyway.

    Thanks,
    Chris

    RC3 is definitely incompatible with FileUpload. You'll need to upgrade.

    RC means "Release Candidate" ... its a version before we even release vanilla 2.0, and we're already at 2.0.14. Please upgrade ;)

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • TimTim Lord of Servers Vanilla Staff
    Ive issue with version 1.1. I'm using vanilla forum version 2.0.9. this is the scenario

    1. type in my comments then attach a file, attach file successful.
    2. When i want to post my comment, after posted the comment the attached file does not upload. It did not store into the database. even those old uploaded files doesn't work either. I cant download old files. When i go to /discussion/download/'mediaid'/filename, it seems to be blank page....no download popup windows at all.

    Help....in trouble now :(
    Not sure what could cause this. Try turning on real errors by going to your config file
    /conf/config.php

    Change this setting:
    $Configuration['Garden']['Errors']['MasterView']

    To this value:
    'deverror.master.php'

    Try doing those actions again and see if you get errors. Another thing you could try is UPDATING to the latest FileUpload and Vanilla. I fix errors daily :)

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • TimTim Lord of Servers Vanilla Staff
    So, I installed PHP-APC using apt-get on my ubuntu server, but I still do not get my realtime progress bars. What could possibly be the issue?
    I think I know what you've missed. If you check out this tutorial:
    http://www.haughin.com/2007/10/23/php-upload-progress-with-php-52-apc/

    The important parts that you might not have done are:
    Now it’s time to enable this hidden upload progress gem….
    edit your /etc/php.ini file and add this line to the bottom:

    apc.rfc1867 = on

    All done? – Great… now we can start playing with the code.

    Restart Apache

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • So, I installed PHP-APC using apt-get on my ubuntu server, but I still do not get my realtime progress bars. What could possibly be the issue?


    I think I know what you've missed. If you check out this tutorial:
    http://www.haughin.com/2007/10/23/php-upload-progress-with-php-52-apc/

    The important parts that you might not have done are:

    Now it’s time to enable this hidden upload progress gem….
    edit your /etc/php.ini file and add this line to the bottom:

    apc.rfc1867 = on

    All done? – Great… now we can start playing with the code.

    Restart Apache
    Thanks Tim, that did the job. Never try to get something working at 4 in the morning when you had too much soda.
  • Every time i try to use this plugin, it wont save the file to the server, and I dont see a download link to the attachment when i post the comment, Why the heck does it just never work? I have that Progress bar thing enabled <-- Very easy.

    But im still not able to make this work. I've looked in permission settings and all that...
  • TimTim Lord of Servers Vanilla Staff
    What is your workflow? Could you tell me exactly what you do to try and attach a file?

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

  • TimTim Lord of Servers Vanilla Staff
    But please do it in a new help thread. This thread is for an old version of File Upload

    Vanilla Forums Senior Developer [GitHub, Twitter, About.me]

13»
This discussion has been closed.