SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 there a way programatically copy a file from source to target dob lib? Source would be always static. target may vary.

share|improve this question
Are you using 2010? – Lori May 31 '11 at 22:07
up vote 1 down vote accepted

Here is a good example that should work either on 2007 or 2010

share|improve this answer
Thanks for finding the solution. I was under the time crunch so I just used spfile.add method and adding files from local. – Robert G May 31 '11 at 22:37
Glad to be helpful :) – Renzo May 31 '11 at 22:52

If you are using 2010, you can use the Content Organizer as well. It will route the items to the appropriate location based on metadata and rules. This would save you the need to use code when you can do it out of the box.

share|improve this answer

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.