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.

FileUpload : cannot upload file > 2M

I have download FileUpload Plugins (v1.5.2). When I try to upload file > 2M it shows "The uploaded file was too big (max 2M).". According to one of the suggestion on the forum, I checked the conf/config-defaults.php . I changed MaxFileSize to 500M. After this also the problem was not solved. Kindly suggest what else should be changed.

Tagged:

Comments

  • TamaTama ✭✭✭
    edited September 2013

    I think this grabs the setting from your php.ini file, some shared hosts will allow access to it.
    Might be something like this

    ; Maximum allowed size for uploaded files.
    upload_max_filesize = 2M
    
    ; Must be greater than or equal to upload_max_filesize
    post_max_size = 2M
    

    There was an error rendering this rich post.

  • Tama is right. Also, if your host uses Nginx for its web server, there should also be a setting called client_max_body_size which should be updated along with PHP's settings.

    Add Pages to Vanilla with the Basic Pages app

  • I grepped upload_max_filesize and post_max_size. I end up with following output

    $grep -r upload_max_filesize
    library/core/class.upload.php: $MaxFileSize = self::UnformatFileSize(ini_get('upload_max_filesize'));
    plugins/FileUpload/class.fileupload.plugin.php: $FileMaxSize = Gdn_Upload::UnformatFileSize(ini_get('upload_max_filesize'));
    plugins/FileUpload/class.fileupload.plugin.php: $MaxUploadSize = ini_get('upload_max_filesize');
    plugins/FileUpload/class.fileupload.plugin.php: $MaxUploadSize = ini_get('upload_max_filesize');

    $$ grep -r post_max_size
    library/core/class.upload.php: $MaxPostSize = self::UnformatFileSize(ini_get('post_max_size'));
    plugins/FileUpload/class.fileupload.plugin.php: $PostMaxSize = Gdn_Upload::UnformatFileSize(ini_get('post_max_size'));
    plugins/FileUpload/class.fileupload.plugin.php: $PostMaxSize = ini_get('post_max_size');
    plugins/FileUpload/class.fileupload.plugin.php: //$PostMaxSize = ini_get('post_max_size');

    Nowhere in vanilla the limit is forcibly defined.

    My webserver has apache2 installed. I am very new to this. Kindly help.

  • @Tama - already told you.

    the ini_get gets the php settings.

    call your host and ask them if you can change php.ini file or if they can to increase maximum size for uploads.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks Tama and Shadowdare. I located the php.ini and changed the setting.

Sign In or Register to comment.