1

I found this nice article about copying files from one location to another FIXED location.

http://www.learningsharepoint.com/2011/05/28/sharepoint-2010-ecmascript-copymove-files-to-another-document-library-part-2/

However this copies but not moves, I can't find any documentation about moving files using ecmascript, but I suppose it should be possible.

Any ideas?

3 Answers 3

2

Replace the line of code - File.copyTo(_destinationlibUrl, true);

to

File.moveTo(_destinationlibUrl, true);

It should work.

1
  • You should be using the enum from the answer below: File.MoveTo(_destinationLibUrl, SP.MoveOperations.none); Commented Jan 25, 2013 at 20:14
3

You need to set operation flag instead of boolean variable as the second parameter. For example

File.MoveTo(_destinationLibUrl, SP.MoveOperations.none);

here's a link to a full list of possible operations:

http://msdn.microsoft.com/en-us/library/ee556657.aspx

0

Try this

File.moveTo(_destinationlibUrl,1); 

This is what got it working for me

1
  • Please provide more information. Commented Mar 25, 2014 at 11:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.