SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to create a directory in SharePoint from c# code without using the Microsoft.SharePoint assembly? I would like to create some folders and upload after that few files to them. I think the upload is not the problem. The program should run on a Non-SharePoint machine, so I cannot use the assembly. Any ideas? Greetz.

Edit Or is it possible to add the metadata to the folder, if I create them about the WebDAV of SharePoint?

share|improve this question
up vote 0 down vote accepted

Yes there are a variety of ways. I would recommend using SharePoint's web services and calling the UpdateListItems method. You'd build XML like:

<Method ID="1" Cmd="New">
   <Field Name="ID">New</Field>
   <Field Name="FSObjType">1</Field>
   <Field Name="BaseName">Name</Field>

Then, using the C# example at the bottom you can call the webservice.

There are other ways to create folders by using webdav which may be worth investigating.

share|improve this answer
Well, I will have a look tomorrow and gave you feedback, how it works. – hofmeister Mar 7 '12 at 15:35
A benefit from using web services is that you can add additional Field nodes for your folder's metadata. – Kit Menke Mar 7 '12 at 17:43
Does the UpdateListItems method also work for libraries in SharePoint? It sounds like it’s for lists and pages with asmx extension. Greetz? – hofmeister Mar 8 '12 at 6:24
In addition, does the program run on a pc without SharePoint installation, if I use the SharePoint Services? – hofmeister Mar 8 '12 at 6:48
1) Yes it works for libraries. 2) The asmx extension means it is a webservice. 3) Yes, no SharePoint installation needed. I would recommend getting familiar here:… – Kit Menke Mar 8 '12 at 16:07

An easy way, but not always possible, is to use the webdav features of SP.

You can navigate with windows explorer using :

share|improve this answer
Yea, that’s actually the way which I use at the moment… But sadly the Metadata are missing at the directories. Could I add them afterwards? – hofmeister Mar 7 '12 at 15:30
You can use an Http PUT query to drop files, then use the webservices to manipulate the data (also possible using webdav, but never tried) – Steve B Mar 7 '12 at 16:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.