in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

Upload file in sp site using sp object model where the site is on another server

Last post 07-02-2008 9:17 AM by satish_gorijala. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 07-02-2008 9:17 AM

    Upload file in sp site using sp object model where the site is on another server

    HI, i have 2 servers 150,160 under same domain. i.e 192.168.0.150, 192.168.0.160 under same domain "ORG11" In 150 Server Sharepoint has been installed and also vs 2005 In 160 only vs2005 has been installed. I need to upload a file using sp object model which can be done at 160 server by using following code string destUrl = Server.UrlPathEncode(http://moss:14499/Shared Documents/satish/NewDocument.txt); SPWeb site = new SPSite(destUrl).OpenWeb(); site.AllowUnsafeUpdates = true; Stream fStream = File.Open(@"C:\NewDocument.txt", FileMode.Open); byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); site.Files.Add(destUrl, contents); fStream.Close(); Is it possible to do this. if so, how can i do to upload file in 150 server. is there any domain restriction for this?
Page 1 of 1 (1 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.