programmatically upload files in sharepoint 2010

me24hour used Ask the Experts™
I have 2 folders. The first folder carries 3 files and the second folder carries 4 files.
I want to upload those files into sharepoint in a way such that:
1) It creates two document libraries in SP. Each document library will have the same as the folder name.
2) Each document library will carry the files that are present in the folder.
3) There is one excel sheet at the root location which carries metadata associated with all the files.
4) code should read the metadata from the excel sheet and update that metadata information while uploading file into the sharepoint document library.

I want to use C# code to do this.
Any help is highly appreciated.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®


I am using the following link.

Please let me know if there are any changes i need to make in this code.
You might just invoke a tool called DavCopy:(

The other way to do this is via webservices.   You could use lists.asmx.  Here is one of the better articles discussing this:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial