Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

SPFile MoveTo method - question

  Asked By: Chaim Odom         Date: Feb 13, 2006      Category: Sharepoint      Views: 1097
 

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

msdn2.microsoft.com/en-us/library/ms470176.aspx

Tagged:        

 

2 Answers Found

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

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, 2006       

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

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


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].