예제 #1
0
        /*
         * Handles the uploading of documents to database.
         * */
        private void AddRequestFilesToResource(ValidationRequest requestModel, HttpPostedFileBase[] files)
        {
            foreach (var file in files)
            {
                if (file != null)
                {
                    //upload blob and get file name
                    //get file name
                    string fileName = studentActions.UploadBlobFile(file);

                    BlobModel blobModel = studentActions.GetAzureValidationReqObject()
                                          .GetBlobs()
                                          .Where(model => model.FileName == System.Web.HttpUtility.UrlPathEncode(fileName))
                                          .FirstOrDefault();

                    blobModel.FileName = HttpUtility.UrlDecode(blobModel.FileName);

                    studentActions.UploadRequestToResource(requestModel, blobModel);
                }
            }
        }