From 26441a244b806503de6caf8f02316be21b567a30 Mon Sep 17 00:00:00 2001 From: Mona Lisa Date: Thu, 27 Jul 2017 17:11:00 +0000 Subject: [PATCH] Support for empty arrays. --- src/upload.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/upload.js b/src/upload.js index 8da9b27e..95f611dc 100644 --- a/src/upload.js +++ b/src/upload.js @@ -259,6 +259,9 @@ ngFileUpload.service('UploadBase', ['$http', '$q', '$timeout', function ($http, function addFieldToFormData(formData, val, key) { if (val !== undefined) { + if(Array.isArray(val) && !val.length) { + return formData.append(key, ''); + } if (angular.isDate(val)) { val = val.toISOString(); }