예제 #1
0
        private void LoadFile(Session session, FileInfo file, ContentCreateOptions options)
        {
            Logger.Info("Entering LoadFiles");
            String uris = file.FullName.Replace("\\", "/");

            Marklogic.Xcc.Content content = ContentFactory.NewContent(uploadFileLocation + file.Name, file, options);


            session.InsertContent(content);
            Logger.Info("Content inserted successfully");
        }
예제 #2
0
        private void LoadFiles(Session session, FileInfo[] files, ContentCreateOptions options)
        {
            Logger.Info("Entering LoadFiles");
            String[] uris = new String[files.Length];


            for (int i = 0; i < files.Length; i++)
            {
                uris[i] = files[i].FullName.Replace("\\", "/");
            }

            Marklogic.Xcc.Content[] contents = new Marklogic.Xcc.Content[files.Length];

            for (int i = 0; i < files.Length; i++)
            {
                contents[i] = ContentFactory.NewContent(uploadFileLocation + files[i].Name, files[i], options);
            }

            session.InsertContent(contents);
            Logger.Info("Content inserted successfully");
        }