public void CreateDocumentImage(string documentName, string user, string secret, string folderPath, out string docWithoutExt, out ApplicationKey appKey) { var libraryName = Common.Configuration.ApplicationConfiguration.LibraryName; var applicationKeyService = new ApplicationKeyService(); var extArr = documentName.Split('.'); docWithoutExt = documentName.ReplaceWithEmpty("." + extArr[extArr.Length - 1]); var dirPath = ApplicationConfiguration.RemoveDirectoryNFileFromServer.StartWithSlash() + "/"; var key = Guid.NewGuid(); var guidFileName = key + "." + extArr[extArr.Length - 1]; var document = new DocumentLibrary() { Name = documentName, FolderPath = folderPath, LibraryName = libraryName, LocalDirectoryPath = dirPath, GuidDocumentName = guidFileName }; var mobilityDocumentsService = new MobilityDocumentsService(); mobilityDocumentsService.GetDocumentFromSharepointLibrary(document, user, secret, Common.Configuration.ApplicationConfiguration.DocStorePath); appKey = new ApplicationKey() { AppId = Guid.NewGuid(), Key = key, DocumentName = guidFileName, OriginalDocumentName = documentName, DocumentPath = dirPath, UserName = user, CreatedDate = DateTime.Now, CreatedBy = user, IsDeleted = false, LastUpdatedDate = DateTime.Now, LastUpdatedBy = user, CurrentPage = 1, StatusId = (int)ProcessorStatus.UnProcessed }; applicationKeyService.InsertApplicationKey(appKey); }