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.

Advanced editor

Hi, I want to upload Files like -mp3 and mp4 in Adc´danced editor but it doesn't work (txt. jpg and zip works correct). I get the Message "File not allowed". Where can i change the file extensions that were allowed?

Hope someone can help me.

Thanks

Matthias

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Add this to the end of your /conf/config.php file and change it so that it includes the files you like to allow:

    $Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tiff', 'ico', 'zip', 'gz', 'tar.gz', 'tgz', 'psd', 'ai', 'fla', 'pdf', 'doc', 'xls', 'ppt', 'docx', 'xlsx', 'log', 'rar', '7z');

    whu606
  • Yeah, it works. Thanks a lot.

  • R_JR_J Ex-Fanboy Munich Admin

    Gern geschehen =)

  • Sorry, it doesn't work. I made a mistake while testing...

    Vanilla is installed on www.daishinzen-forum.de/dz_vf

    I added these lines to conf/config.php:
    $Configuration['Garden']['Upload']['MaxFileSize'] = '50M';
    $Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tiff', 'zip', 'pdf', 'doc', 'xls', 'docx', 'xlsx', '’mp3’', '’mp4‘');

    and if i want to upload a file e.g.: max.mp3 with 12 MB
    I got the error message:

    File is not allowed and is too large (max 2097152 bytes).

    little mp3 files with 50kb didn't work either.

    It works with txt, jpg, zip files with a max of 2MB
    .

    I'm very confused, need help.

    Thanks

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    You need to use single quotes on that list...

    $Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tiff', 'zip', 'pdf', 'doc', 'xls', 'docx', 'xlsx', 'mp3', 'mp4');

    Also, the uploads limit on your host is what decides how much you can upload no matter how high you put it in the vanilla config.

    Ask your host wha your limit is. Large files should be zipped before uploading.

    R_J
  • Problem 1: was my vault, i pasted the old lines with double quotes.

    in the config.php were single quotes, although it doesn't work...
    I Loaded a file with 1 mb called test.pdf --> works. i renamed it test.mp3 --> doesn't work

    Problem 2: I will ask my host what the limit is. Thanks

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I Loaded a file with 1 mb called test.pdf --> works. i renamed it test.mp3 --> doesn't work

    You can't expect to fool the server into thinking a file is an mp3 just by changing the extension.

    Here is proof that it works for me

    http://vrijvlinder.com/forum/discussion/58/testing-mp3-upload?new=1

  • sorry, it doesn't work.

    proofed it with your file --> " File ist not allowed".

  • R_JR_J Ex-Fanboy Munich Admin

    There is still something wrong with the text you are using. This arrayed is passed as a JavaScript array to the source code of your forum and so by looking at it I found that:

     "allowedFileExtensions": "[\"txt\",\"jpg\",\"jpeg\",\"gif\",\"png\",\"bmp\",\"tiff\",\"zip\",\"pdf\",\"doc\",\"xls\",\"docx\",\"xlsx\",\"\\u2019mp3\\u2019\",\"\\u2019mp4\\u2018\"]",
    

    As you can see, there seems to be some wrong character user for quotation. Be sure to use this character (copy and paste it from here): '

    And don't use word or any "smart" text processing tool to edit this string since it might think it has to make your apostrophe more pretty and change it...

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    It does not work for you, but it works. You must find out why on your installation it is not working... the only thing that allows or disallows file types or weight are these lines in the config.php this is what I have...

    $Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt', 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'tiff', 'zip', 'gz', 'tar.gz', 'tgz', 'psd', 'ai', 'fla', 'swf', 'pdf', 'doc', 'xls', 'ppt', 'docx', 'xlsx', 'log', 'rar', '7z', 'mp3', 'wav', 'aiff', 'mov', 'cur');
    $Configuration['Garden']['Upload']['MaxFileSize'] = '64M';
    $Configuration['Garden']['AllowFileUploads'] = true;
    
  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited May 2017

    Yes, you must be very careful what and how you add stuff on the config.php

    Use a text editor such as Sublime text..

  • Thanks for your help. There were false quotation marks. Now it works.
    Changed the editor to sublime.

    For increasing the max file size i had to add these lines in .user.ini:

    upload_max_filesize = 1024M
    post_max_size=2048M
    max_execution_time = 300

    It works, but don't ask me why....

    vrijvlinder
Sign In or Register to comment.