c# - How to move files with metadata in SharePoint? -


i have written code copies files , metadata new url. reason it's copying metadata word , excel files. non-microsoft, pdfs not metadata copied. code below, see should change?

also, code worked pdfs when ran under 2007...

static void copyfilewithhistorycrosssite(spfile sourcefile, spfolder destination, string destinationurl) {     byte[] binfile;      binfile = sourcefile.openbinary();      destination.files.add(destinationurl, binfile, true); } 

this code not "copy metadata" in destination, metadata recreated based on stream of file's stream (it called "property promotion", see http://msdn.microsoft.com/en-us/library/aa979617.aspx).

try spfile.copyto/moveto think may copy metadata.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -