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.

how to whitelist other files extensions

Hi, on my forum, i want to whitelist .log extensions for files upload. How to do that?

Comments

  • Search in your /conf/config.php for a line like that $Configuration['Garden']['Upload']['AllowedFileExtensions'] = ['txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tiff', 'ico', 'zip', 'gz', 'tar.gz', 'tgz', 'psd', 'ai', 'fla', 'pdf', 'doc', 'xls', 'ppt', 'docx', 'xlsx', 'pptx', 'log', 'rar', '7z'];.
    If you do not find a line like that in the config, search in /conf/config-defaults.php and copy that to your config.php
    Afterwards just add 'log', to that line

  • hum i had the line but log files don't upload, i have a "The file failed to upload." and a 400 error in my browser inspector...I tried to upload a 7z file and it's not working too...

  • There are several things to look at:

    1. 'Garden.Upload.AllowedFileExtensions' must contain the file extension
    2. The file size must be below 'Garden.Upload.MaxFileSize'
    3. The /uploads folder must be writable

    So if even uploading a small jpg picture fails (you should try that), you most probably have a file permission problem

  • 1 2 and 3 are ok and i can't upload a .log file...pdf, jpg, png, etc are ok....
    I think default extensions are ok but

  • @pioc34 said:
    1 2 and 3 are ok and i can't upload a .log file...pdf, jpg, png, etc are ok....
    I think default extensions are ok but

    a simple test. create a text file with name and contents as below.

    simple.txt

    this is a test.
    this is a test.

    see if you can upload it. if successful. rename the file to simple.log and try to upload it.
    if it fails something in your config or server config won't allow it.

    if it fails try another extension - add 'fog' to your config line.

    and rename the file to simple.fog and try to upload if it fails you probably have a problem in the config.php if it is successful and the log file upload still fails and the line in config contain both log and fog then you might like into server config that might be preventing the extension.

    see

    https://open.vanillaforums.com/discussion/comment/220596/#Comment_220596 and other questions.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

  • I tried your test:

    i made a file simple.txt and i can upload it to a discussion. I tried to rename the file to simple.log but i can't upload it.
    I tried to add a fog extension in my config file but i can't upload a simple.fog file.

    So, i download directly the editor files on https://github.com/vanilla/vanilla and i upload them to my server and everything is ok!!

    Thanks to all

Sign In or Register to comment.