AnsweredAssumed Answered

Accessing bulk import utility externally

Question asked by srowsell on May 10, 2013
Latest reply on Nov 27, 2014 by billydoe
I'm trying to run the bulk file import utility using a C# web page.  This is a POST web script (alfresco/service/bulkfsimport/initiate), so I can't put the various parameters into the URL.  Anyway my code looks something like this:

<blockcode>using (var wb = new WebClient())
        {
           
            var data = new System.Collections.Specialized.NameValueCollection();
            //data["alf_ticket"] = ticket;
            data["sourceDirectory"] = @"C:\Temp\Statements";
            data["targetPath"] = "/Company Home";
            //data["targetPath"] = "/Company Home/Sites/general/documentLibrary/Statements";
            data["replaceExisting"] = "true";
            data["disableRules"] = "true";
            data["batchSize"] = "50";
            data["numThreads"] = "4";
            string url = "http://localhost:8080/alfresco/service/bulkfsimport/initiate?alf_ticket='+ticket;
            //string url = "http://localhost:8080/alfresco/service/bulkfsimport/initiate";
            var response = wb.UploadValues(url, "POST", data);
        }</blockcode>

I've tried including the ticket both as part of the POST object and as part of the URL.  Every time I try this I get a 401 authentication error, and yes, I'm sure that I'm using good credentials.

Any thoughts?

Outcomes