Wednesday, 28 August 2013

Archive file from a document library to another with metadatas

Archive file from a document library to another with metadatas

I'm quite a newbie concerning the SharePoint API, but I have been asked to
code something quickly with it.
I have to programmatically move files from a document library to another,
an "archive" one, on the same site and preserve the file's metadatas. This
will happen on a SharePoint 2010 farm.
From now on, I've been able to identify the expiration date of each file
in the library. If the expiration date is inferior or equal today, than I
must archive the file.
The "Archive" Library has been created in order to be identical to the
original one.
It seems, from what I've been told and what I read, that a simple copy
will lose those metadatas.
I've of course searched on Google, but I've been lost from going to one
site to another one, with so many examples that I do not know if it fit my
simple case...
Have you been confronted with this kind of problems ? Is there a sample of
code out there that could help me ?
Many thanks in advance,
JN

No comments:

Post a Comment