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.
Options

Large files fail to upload

2»

Comments

  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    yes you can increase your memory limit. 70m is fairly low. try 128M or even 256M. if you can support it.
    your conversion is probably pooping out due to memory_limit as already suggested.

    you should not change your editor plugin line. set it back to.

    $ConfigMaxSize = Gdn_Upload::unformatFileSize(c('Garden.Upload.MaxFileSize', '1MB'));

    Not sure if you really want to change your max_execution_time, try the memory first.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Yes I resolved it , but can't recall exactly what I did. I think I hacked the core. Something that should not be necessary. I think it was fixed in 2.2 though.

    You should first try to change the php settings as I posted above and see if that resolves the issue. If not then, something may be wrong in the core files still.

    Try adding this config to the config.php if you haven't already .. worth a try. Delete the .ini files in the cache and try the upload again.

        $Configuration['Garden']['Picture']['MaxHeight']                = 4000;
        $Configuration['Garden']['Picture']['MaxWidth']                 = 3000;
    
  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    Wild goose chase or following logic, which will it be?

  • Options
    noncenonce Necro-on Forensics

    My guess... since everyone is guessing in this discussion.

    I don't think these are used in the core or in the editor plugin!

    $Configuration['Garden']['Picture']['MaxHeight']
    $Configuration['Garden']['Picture']['MaxWidth']

    they seem to be remnants in the config.defaults.php that are not used anywhere. unless it is a third party plugin.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    Probably a red herring ?
    I did find something unusual in the editor plugin. Maybe it has nothing to do with this issue though…

    Considering that FileUpload plugin is not being used, I wonder why this config is in there

     // Create thumbnail, and grab debug data from whole process.
            $thumb_payload = generate_thumbnail($local_path, $thumb_destination_path, array(
             // Give preference to height for thumbnail, so height controls.
             'height' => c('Plugins.FileUpload.ThumbnailHeight', 128)
            ));
    

    and again here

    $url = asset('/plugins/FileUpload/images/file.png');

    And here too

        protected function getEditorToolbar($attributes = array()) {
                $editorToolbar = array();
                $editorToolbarAll = array();
                $allowedEditorActions = $this->getAllowedEditorActions();
                $allowedEditorActions['emoji'] = Emoji::instance()->hasEditorList();
                if (val('FileUpload', $attributes)) {
                    $allowedEditorActions['uploads'] = true;
                    $allowedEditorActions['images'] = false;
                }
    
  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    the editor is different then the fileupload plugin. not worth discussing - just adds to confusion.

    not worth commenting here until the op ups their memory limit to 128 or 256 and reports results.

    the editor works on this site with jpg the author has a problem with.

    or they can try useless voodoo incantations.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited March 2016

    The code above IS from editor plugin … so why does it contain FileUpload configs etc?

    It may be they missed something ? Or they thought everyone would already have FileUpload plugin so then editor plugin would be able to use the same files and configs ? I think not…
    maybe @Linc can shed some light...

  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    not worth commenting here until the op ups their memory limit to 128 or 256 and reports results.

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    That is not only illogical , it makes no reasonable sense at all. It is impractical specially if people are using Vanilla for the first time and they do not have FileUpload.
    And also in the FileUpload plugin page they expressly claim that FileUpload is not necessary if you use editor….

    Sorry, but I must disagree with your logic assessment ..

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @nonce

    People are on here trying to help.

    It's clear you are knowledgeable in php, and good that you are prepared to help out.

    However, either you mean to be snotty to and about others, in which case, please don't be, or you don't, in which case perhaps you would consider how you come across?

  • Options
    noncenonce Necro-on Forensics
    edited March 2016

    regarding op question - large files fail to upload with editor plugin - image specific.

    regarding other config suggestion:

    I can't see anywhere that these are used, except in config.defaults.php

    $Configuration['Garden']['Picture']['MaxHeight']
    $Configuration['Garden']['Picture']['MaxWidth']

    they seem to be remnants in the config.defaults.php that are not used anywhere.

    please kindly point me to a place where they are used in any plugin or in the core,

    regarding original problem:

    yes you can increase your memory limit. 70m is fairly low. try 128M or even 256M. if you can support it.
    your conversion is probably pooping out due to memory_limit as already suggested.

    you should not change your editor plugin line. set it back to.

    $ConfigMaxSize = Gdn_Upload::unformatFileSize(c('Garden.Upload.MaxFileSize', '1MB'));

    Not sure if you really want to change your max_execution_time, try the memory first.

    if after you change to 128M or 256M and test and still have problems. perhaps I can help you further, otherwise personally I would only be guessing if you don't report your results changing the memory_limit.

  • Options

    Thanks for all the help.

    Changed back the editor plugin line to 1MB.

    Upped memory limit to 128M (256M seem to not do anything - the limit just says at 128M when I tired this)

    Sadly after all of that still no change, just a file upload error!

    I've disabled all the plugins apart from the editor and changed the theme back to the original and still no luck.

    Maybe because I'm on shared hosing images are just too big for the server to handle? Its a shame as I wanted people to be able to upload photos directly from their phones, my phone is quite old but still the images are 3k*4k.

  • Options

    Is there a way to turn off the thumnail generation? I'd rather not have thumbs and make the images display inline like they do on this site. Is that a custom setting VF.org use?

  • Options
    vrijvlindervrijvlinder Papillon-Sauvage MVP

    You could try using the Uploader plugin along with the editor. You can use both at once I believe. See if that works and then we can have more to work with in terms of what to do to fix editor uploading large files.

  • Options
    noncenonce Necro-on Forensics

    @essbo said:
    Is there a way to turn off the thumnail generation? I'd rather not have thumbs and make the images display inline like they do on this site. Is that a custom setting VF.org use?

    Hullo Guvnor,

    First off you could try with 128M memory limit (the max you can do, you said) and you could try upping the execution time. If it doesn't work, I would set the execution time back to its original state but leave the memory_limit at 128M

    I am but a wee volunteer that has offered to help you. Only someone with access and knowledge regarding vf.org could tell you some of your answers. Yes I agree with previous poster, File Upload plugin and alter egos will work with the regular editor and the original copy should be a moved file without conversion. you could comment out thumbnail generation, and you might have a chance.

    Alternatively, you could wait for the next version of vanilla and see what happens. Or sign up for the cloud. Or move to non-shared hosting platform (imho the best option). And another option that may draw criticism, ire and outrage - other forum software. Best to keep an open mind about everything. Having blinders on with a closed mind can restrict your abilities, at least that's what me mum toll me.

    Now if you want to use the editor plugin with a mod to the editor plugin itself. Here is an educated guess, but you will have to test in your environment.

    here is an option WITHOUT the file upload plugin enabled and using a modified editor change.


    // Save original file to uploads, then manipulate from this location if
    // it's a photo. This will also call events in Vanilla so other
    // plugins can tie into this.

    • $imageType = ""; // fool imageType
      if (empty($imageType)) {
      $filePathParsed = $Upload->saveAs($tmpFilePath, $absoluteFileDestination, array('source' => 'content'));
      } else {


    $imageWidth = $tmpwidth;
    $generate_thumbnail = true;

    }

    • $generate_thumbnail = false; // set flag on gneration of thumbnails to false again.
      // Save data to database using model with media table
      $Model = new Gdn_Model('Media');

    after the code is changed in the editor plugin,

    <after code changes - to upload and insert image

    click the x on the attachment below the body box after upload occurs. the attachment icon will fade, then hover on the faded icon and you will see re-attach image. then post document.

    I think it will work, sadly you will want to improve it, and sadly I have to stop here, but happily someone else can pitch in with time and effort.

    If it doesn't work, you can adjust as you feel necessary.

  • Options

    Thanks all for your help. I think I'm just trying to do too much on my shared hosting.

    I'll just make it so people can't upload large images. I do really like vanilla so wouldn't want to switch software. Even xenforo doesnt seem to let you upload large images.

  • Options
    whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @essbo

    I use the image upload plugin as opposed to the advanced editor.

    Our photo uploads are just for 'info' rather than to showcase images.

    It automagically resizes images, so I can allow users to upload a 5mb file, but it posts as less than 100KB.

    I find the 5mb limit is needed as mobile photos can be up to that size.

  • Options

    @whu606 said:
    @essbo

    I use the image upload plugin as opposed to the advanced editor.

    Our photo uploads are just for 'info' rather than to showcase images.

    It automagically resizes images, so I can allow users to upload a 5mb file, but it posts as less than 100KB.

    I find the 5mb limit is needed as mobile photos can be up to that size.

    Thanks I'll try that one :)

Sign In or Register to comment.