Can't upload image if option "restrict file type" is set when I do post creation



  • What is the exact syntax to put in the field "Allowed file types, (ie png, pdf, zip). Leave empty to allow all"

    If I leave the field empty I can upload image or whatever but as soon as I put file extension it says after upload that I can't do it because file type is not allowed. I tried all of these without any success
    jpg png pdf zip
    jpg,png,pdf,zip
    jpg, png, pdf, zip
    jpg

    Any ideas ?

    You can do a test on my community, currently setup with jpg only



  • Yes, I got the same problem, any solution?



  • @huasheng
    I can't believe nobody's using this features 😉
    except if we missed a great plugins that do things better, let us know


  • GNU/Linux

    @Charly86
    Indeed, I think some use https://github.com/bdharrington7/nodebb-plugin-imgbed

    But nonetheless, I got some troubles with the upload feature myself. I think it needs some attention, generally.



  • Ok guys, solved !!!!
    Just went into source file and done some debugging. No luck I had, in fact type we need to put in this field should match I think mime type and this one can be different than file extension.
    So if you want to upload .jpg (the tests I've done) you need to put in this box
    jpeg (type) and not jpg (file extension)
    and if you want to allow upload upload of .jpg and .png (file extension is the same than type for this one) you need to comma separated so
    jpeg,png
    may be changing text above this field would allow users to understand better 😉

    I'm now working with the following configuration
    jpeg,png,gif
    works like a charm 😉


  • GNU/Linux

    Haha, nice one. I need to correct myself, too. 😓
    Turns out I just wanted more, more, more(!), again. 🙂


Log in to reply
 

Suggested Topics

| |