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
Post a Comment