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.

Large files fail to upload

Just tested here and it seems to work fine. On mine if I take a photo and uplaod it always fails, unless it is a small size.

I'm using the advanced editor.

«1

Comments

  • Oh and here the photo shows in the post rather than the thumbnail. Is there an option to do this also on my forum?

  • @whu606 said:
    Check your conf/config.php file and add or change this setting to your preferred file size:

    $Configuration['Garden']['Upload']['MaxFileSize'] = '10M';

    You may need to edit your php.ini file as well, (and your conf file if you are using Nginx - client_max_body_size 10m;

    Thanks I've set the file upload size to 50m.

    Still not working, not sure if its vanilla or not. It sounds like a hosting error, but my wordpress on the same site can upload the files but they dont work on vanilla.

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

    If you've got separate php.ini files for the two installs, you'll need to check the one for Vanilla.

  • edited March 2016

    is php.ini an editabled file or controlled by webhosts?

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

    @PettyGripesCom

    When I had a hosted site, it was editable by the owner (i.e. me), so it should be editable. (Although some web hosts do seem to do odds things...)

  • @whu606 said:
    If you've got separate php.ini files for the two installs, you'll need to check the one for Vanilla.

    Just checked, they are both using the same php.ini ( /etc/php56/php.ini - so not a file I have access to)

    Is there anyway to get more details from vanilla when a file upload fails? I noticed when i set the limit at 10kb I got a different message.

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

    @essbo

    You need to ask your host to provide access or edit it for you.

  • @whu606 said:
    @essbo

    You need to ask your host to provide access or edit it for you.

    But seeing as wordpress and vanillia use the same php.ini file doesnt it mean its not the problem as files more than a few meg can be uploaded in wordpress but not vanillia?

  • to be sure, create a php file in which with these lines of code:

        <?php
        phpinfo();
        ?>
    

    Name this file info.php and upload it to your root folder. Then call it via de url: yourdomain.com/info.php
    Look for upload_max_filesize and post_max_size

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

    @essbo

    The only other thing I can suggest is checking the file class.editor.plugin.php in the editor folder in plugins

    Look for this line:

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

    around line 632.

    Try changing that and seeing if that has any effect.

  • @jackmaessen said:
    to be sure, create a php file in which with these lines of code:

        <?php
        phpinfo();
        ?>
    

    Name this file info.php and upload it to your root folder. Then call it via de url: yourdomain.com/info.php
    Look for upload_max_filesize and post_max_size

    They are 64M and 65M respectively, sadly its not that

  • essboessbo New
    edited March 2016

    @whu606 said:
    @essbo

    The only other thing I can suggest is checking the file class.editor.plugin.php in the editor folder in plugins

    Look for this line:

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

    around line 632.

    Try changing that and seeing if that has any effect.

    Thanks, I've just tried changing that to 50MB as per below, is that the right size to check?

    $PostMaxSize = Gdn_Upload::unformatFileSize(ini_get('post_max_size'));
    $FileMaxSize = Gdn_Upload::unformatFileSize(ini_get('upload_max_filesize'));
    $ConfigMaxSize = Gdn_Upload::unformatFileSize(c('Garden.Upload.MaxFileSize', '50MB'));
    $MaxSize = min($PostMaxSize, $FileMaxSize, $ConfigMaxSize);
    $c->addDefinition('maxUploadSize', $MaxSize);

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

    The size is simply whatever filesize you are prepared to allow.

    For checking purposes, personally I'd keep all references to filesize the same.

    When I had an issue similar to this, I had a range of file sizes from small to large ready to upload, and kept trying until I found one that wouldn't upload.

    That gave me an idea of what to look for.

  • noncenonce Necro-on Forensics

    Is there anyway to get more details from vanilla when a file upload fails?

    yes. but first the above comments are but snippets of info and is more fully discussed in the Tutorials. you may want to investigate.

    I am going to suggest this:

    instead of rehashing things like the above comments except this rehash.
    all of the above info (except nginx) is in the Tutorials category in better detail. regarding file uploading, extensions and debugging.

    also instead of rehashing in less detail, I'll point you here.

    https://vanillaforums.org/discussion/31823/image-not-uploading-within-posts

    determine the value with the console.

    the file you have trouble you are having trouble with is a 5MB jpg file - correct.

    try uploading 5 mb zip file and 500kb zip file after allowing zip extensions.

    if you are not running out of memory during conversion and memory is exhausted

    you need to increase your memory limit.

  • Thanks @nonce @whu606

    Checked with large zips and large in mb size and it works fine (10 mb zip uploaded).

    Looks like it fails with a reasonable high res (4000*3000), so would that mean when its trying to resize it runs out of memory? Is this a PHP seting?

  • Memory limit is 70m
    max_execution_time is 30

    are they a bit low?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I believe the problem is not with the weight of the image but with the dimensions .

    I had a similar issue happen to me with FileUpload and Uploader. I could upload a file or image that weighed a lot and it was fine, but then I uploaded a lighter file but with dimensions of 4000 pixels and it choked. I think the issue was that the image dimensions were too large and a thumbnail could not be created.However the image was uploaded because it appeared in the album.

    Was your image uploaded? Is it in the uploads folder ?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    By the way this is what I have in the phpinfo

    memory_limit 128M

    max_execution_time 120

    max_file_uploads 20

    post_max_size 20M

    upload_max_filesize 20M

  • @vrijvlinder said:
    I believe the problem is not with the weight of the image but with the dimensions .

    I had a similar issue happen to me with FileUpload and Uploader. I could upload a file or image that weighed a lot and it was fine, but then I uploaded a lighter file but with dimensions of 4000 pixels and it choked. I think the issue was that the image dimensions were too large and a thumbnail could not be created.However the image was uploaded because it appeared in the album.

    Was your image uploaded? Is it in the uploads folder ?

    Just checked the folders, it looks like it's created a folder under uploads but no image in it.

    Did you resolve the issue?

    The same image can be uploaded onto this forum and on my WordPress without any issues.

Sign In or Register to comment.