public void UploadDoc(string description, int customerId)
        {
            var files = Request.Files;

            if (files.Count == 0)
            {
                string sError = string.Format("No files received for customer {0}.", customerId);
                Log.Debug("{0}", sError);
                throw new Exception(sError);
            }     // if

            OneUploadLimitation oLimitations = CurrentValues.Instance.GetUploadLimitations("AlertDocsController", "UploadDoc");

            var oErrors = new List <string>();

            for (int i = 0; i < files.Count; i++)
            {
                var file = Request.Files[i];

                if (file == null)
                {
                    string sError = string.Format("File #{0} for customer {1} is null.", i, customerId);
                    Log.Debug("{0}", sError);
                    oErrors.Add(sError);
                    continue;
                }         // if

                var body = new byte[file.InputStream.Length];
                file.InputStream.Read(body, 0, file.ContentLength);

                if (string.IsNullOrWhiteSpace(oLimitations.DetectFileMimeType(body, file.FileName)))
                {
                    string sError = string.Format("File #{0} for customer {1} cannot be accepted due to its MIME type.", i, customerId);
                    Log.Debug("{0}", sError);
                    oErrors.Add(sError);
                    continue;
                }         // if

                var customerRepo = ObjectFactory.GetInstance <CustomerRepository>();
                var customer     = customerRepo.Get(customerId);
                var doc          = new MP_AlertDocument {
                    BinaryBody  = body,
                    Customer    = customer,
                    Employee    = _context.User,
                    Description = description,
                    UploadDate  = DateTime.UtcNow,
                    DocName     = file.FileName
                };

                _docRepo.SaveOrUpdate(doc);
            }

            if (oErrors.Count > 0)
            {
                throw new Exception(string.Join(" ", oErrors));
            }
        }