1 Reply Latest reply: Sep 8, 2008 7:09 AM by 559652 RSS

    Http 401 error when uploading file to content services

    559652
      Hi,

      When i try to upload a document, the document is created in the folder with empty content and i have the 401 http error.

      Someone can help me to resolve thise problem.

      Thank's for advance.
        • 1. Re: Http 401 error when uploading file to content services
          559652
          I found the response to the problem. I summarize the solution in the following point :

          1- when you connect to a standalone content services server via the webservices api, you get a single String as cookie and to upload a document to server you use the same single cookie.
          2- bu when you connect to cluster content services via the webservices api, you get an Array of String as cookies and to upload a document to server you need to transform the array of cookie into a single String cookie to be able to be authenticated by the http server, look to the following code
          String cookie="";
               for(int i=0;i < connection.getCookie().length;i++) {
                    cookie = cookie + connection.getCookie() +";";
               }