if ($scope.attachments.body.rows.length >0 ) { var files = []; $.each($scope.attachments.body.rows, function (index, fileInfo) { files.push(fileInfo.content); }); Upload.upload({ url: 'api/EMessage/UploadFilesWithData', multiple: true, data: { files: files, data: Upload.json(eMessage) } }).then(function (response) { //$timeout(function () { // $scope.result = response.data; //}); var alertMessage = resourceFactory.getResource('Messages', 'sendingProcessCompleted'); toastr.clear(); toastr.success(alertMessage); $scope.disableAction = false; showSearchResults(); return; }, function (response) { if (response.status > 0) { $scope.errorMsg = response.status + ': ' + response.data; } }, function (evt) { $scope.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total)); }); }and the API is very similar to what I had originally in the Upload method. I only tested with Chrome so far, but I hope that files multiple works for other browsers as well.
>> public class FileUploadResult >> { >> public String FileName { get; set; } >> public String Key { get; set; } >> public int PercentComplete { get; set; } >> public HttpPostedFile Content { get; set; } >> >> public string Type { get; set; } >> }>>
>> public class EditMessageViewModel >> { >> public short FormType { get; set; } >> public int MessageId { get; set; } // MessageID (Primary key) >> //public byte ReciptType { get; set; } // ReciptType. Type of recipient. 1=Guest. >> //public decimal ReciptId { get; set; } // ReciptID. ID of the recipient. I.e. if recipient type is a guest, then guest_no. >> public string Body { get; set; } // Body >> // public System.DateTime DateTime { get; set; } // date_time >> // public System.Nullable<System.DateTime> Delivered { get; set; } // delivered >> public System.DateTime Expires { get; set; } // expires >> >> public string MsgFrom { get; set; } >> >> public string Subject { get; set; } >> >> public List<FileUploadResult> Attachments { get; set; } >> >> public List<GuestsList> Recipients { get; set; } >> }>>