Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

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

to

File.moveTo(_destinationlibUrl, true);

It should work.

share|improve this answer
    
You should be using the enum from the answer below: File.MoveTo(_destinationLibUrl, SP.MoveOperations.none); –  iOnline247 Jan 25 '13 at 20:14
add comment

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

share|improve this answer
add comment

Try this

File.moveTo(_destinationlibUrl,1); 

This is what got it working for me

share|improve this answer
    
Please provide more information. –  Karthik Jaganathan Mar 25 at 11:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.