From f2344267980d285164eb8c39502565e7eca1feda Mon Sep 17 00:00:00 2001 From: Alexander Gusev Date: Wed, 31 Aug 2016 17:15:59 +0300 Subject: [PATCH] [FIX #98] add an extra check in upload function add an extra check in upload function, that checks if files variable is an instance of FileList (which in enumerable) --- client/functions.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/functions.coffee b/client/functions.coffee index 55110a1..391fea3 100644 --- a/client/functions.coffee +++ b/client/functions.coffee @@ -57,8 +57,9 @@ Cloudinary = if _.isFunction ops callback = ops ops = {} - - if not _.isArray files + # _.isArray is returning false, when files is instance of FileList + # but we need to iterate thru FileList too, like it is an array + if !_.isArray(files) && !(files instanceof FileList) file = files reader = new FileReader @@ -146,4 +147,4 @@ Cloudinary = # Define helpers Template.registerHelper "c", -> - Cloudinary._helpers \ No newline at end of file + Cloudinary._helpers