javascript - FineUploader allowedExtensions use an array? -
i'm using fineuploader v3.8, , have gotten , running. @ point, i'm listing available file types user in html, , there's reference these in configuration. wanted have 1 place extensions listed there's no duplication, , can changed.
i tried this:
var allowedextensions = new array('jpg', 'gif', 'png');
var allowedextensions = "'jpg', 'gif', 'png'";
and within 'validation:' used this:
allowedextensions: [allowedextensions],
this doesn't work, , invalid file type messagebox any/all file types.
there way utilize array variable in javascript of control configuration? thanks!
with 1st , 3rd snippet, you're creating array
containing array
it needs either array literal ([...]
) or new array(...)
rather both.
var allowedextensions = ['jpg', 'gif', 'png'];
allowedextensions: allowedextensions, // no brackets
Comments
Post a Comment