I want to upload a file to sharepoint document library using C# program. I have used the webservice Copy's API CopyIntoItems to do the file upload. The credentials provided for doing this is the default credentials. When this is tested using a winform application, where the user has write access to document library, this succeeds and the document is uploaded to the document library.
But the same function when it is invoked remotely from other application, it gives a access denied error.
What could be the solution for this?
Please see the code snippet.
Copy copyService = new Copy();
copyService.Url = mySiteUrl + "/_vti_bin/copy.asmx";
copyService.PreAuthenticate = true;
copyService.Credentials = CredentialCache.DefaultCredentials;
copyService.UseDefaultCredentials = true;
........................................
...................................
copyService.CopyIntoItems(destination, destinationUrl, filedInfo, bteFileContents, out cResultArray);