public IActionResult UploadSaveFileInFolderTreeNode(Guid resourceId, string resourceKey, string pathPrefixName, bool isTreeTemplate, string[] fileInfo)
        {
            try
            {
                //Avoiding Kendo Uploader's default call
                if (resourceId == Guid.Empty || fileInfo.Length == 0)
                {
                    return(Ok(true));
                }

                var             fileInfoObj1   = fileInfo[0].Split(',');
                IDocumentEntity documentEntity = new DocumentEntity();
                if (isTreeTemplate)
                {
                    documentEntity = GetTemplateFolderTree(new Guid(fileInfoObj1[5]), "Contract", resourceId, pathPrefixName);
                }
                else
                {
                    documentEntity = _documentManagementService.GetFileOrFolder(new Guid(fileInfoObj1[5]));
                }


                //If new file/s have been uploaded
                if (Request.Form.Files.Count > 0)
                {
                    var files = Request.Form.Files;
                    //foreach (var file in files)
                    for (int i = 0; i < files.Count; i++)
                    {
                        var fileInfoObj = fileInfo[i].Split(',');

                        //save file in folder..

                        var fullPath         = files[i].FileName.Split("\\");
                        var originalFileName = fullPath[fullPath.Length - 1];

                        //var fullPhysicalFilePath = Path.Combine(documentRoot, newTreeStructure.FilePath);
                        var fullPhysicalFilePath = string.Concat(documentRoot, documentEntity.FilePath);

                        var uniqueFileName =
                            _fileService.SaveFile(fullPhysicalFilePath, files[i]);

                        var relativeFilePath = Path.Combine(documentEntity.FilePath, uniqueFileName);

                        //save file info in database..
                        ContractFileViewModel contractFileViewModel = new ContractFileViewModel();

                        contractFileViewModel.ContractResourceFileGuid = new Guid(fileInfoObj[0]);
                        contractFileViewModel.CreatedOn            = CurrentDateTimeHelper.GetCurrentDateTime();
                        contractFileViewModel.UpdatedOn            = CurrentDateTimeHelper.GetCurrentDateTime();
                        contractFileViewModel.CreatedBy            = UserHelper.CurrentUserGuid(HttpContext);
                        contractFileViewModel.UpdatedBy            = UserHelper.CurrentUserGuid(HttpContext);
                        contractFileViewModel.Description          = WebUtility.UrlDecode(fileInfoObj[1]);
                        contractFileViewModel.MimeType             = files[i].ContentType;
                        contractFileViewModel.ResourceGuid         = resourceId;
                        contractFileViewModel.keys                 = resourceKey;
                        contractFileViewModel.UploadFileName       = uniqueFileName;
                        contractFileViewModel.UploadUniqueFileName = uniqueFileName;
                        contractFileViewModel.IsActive             = true;
                        contractFileViewModel.IsDeleted            = false;
                        contractFileViewModel.FilePath             = relativeFilePath;
                        contractFileViewModel.FileSize             = fileInfoObj[4];
                        contractFileViewModel.ParentId             = documentEntity.ContractResourceFileGuid;
                        contractFileViewModel.Isfile               = true;

                        var fileEntity = _mapper.Map <ContractResourceFile>(contractFileViewModel);

                        _contractRefactorService.InsertContractFile(fileEntity);

                        //auditlog..
                        AuditLogForUploadDownload(fileEntity, CrudTypeForAdditionalLogMessage.Uploaded.ToString());
                    }
                }

                //If existing file/s description have been changed
                if (fileInfo.Length > Request.Form.Files.Count)
                {
                    for (int i = Request.Form.Files.Count; i <= fileInfo.Length - 1; i++)
                    {
                        var fileInfoObj = fileInfo[i].Split(',');

                        var fileById = _contractRefactorService.GetFilesByContractFileGuid(new Guid(fileInfoObj[0]));
                        if (fileById != null)
                        {
                            fileById.Description = WebUtility.UrlDecode(fileInfoObj[1]);
                            _contractRefactorService.UpdateFile(fileById);
                        }
                    }
                }

                return(Ok(true));
            }
            catch (Exception ex)
            {
                return(BadRequestFormatter.BadRequest(this, ex));
            }
        }