Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

SPFile MoveTo method - question

  Asked By: Chaim    Date: Feb 13    Category: Sharepoint    Views: 2739

Can you use the SPFile.MoveTo or CopyTo methods to move a document from
a WSS site to another WSS site?




2 Answers Found

Answer #1    Answered By: Alyssa Butler     Answered On: Feb 13

The way I have done in the past is

folderPath = docLibraryFolder+"/"+getFileNameToCopy();
SPFileCollection DestFiles = CreateSPWeb(destURL).Folders[docLibraryFolder].Files;
SPFile myFile = GetSPFile(getSourceURL(), getSourceFilePath());
sourceFileContents = myFile.OpenBinary();
SPFile myFile2 = DestFiles.Add(destURL+folderPath,sourceFileContents,true);

Please let me know if it makes any sense.

Answer #2    Answered By: Katy Patton     Answered On: Feb 13

It is still a little blurry to me, but I'll try to figure it out from

Didn't find what you were looking for? Find more on SPFile MoveTo method - question Or get search suggestion and latest updates.