Tell me more ×
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 cant find any documentation about moving files using ecmascript, but I suppose it should be possible.

Any ideas?

share|improve this question

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 at 20:14

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

I made the change that you recommended above, 'File.moveTo(_destinationlibUrl, true);' but unfortunately I get the error 'input string was not in a correct format'.

Any ideas on what I'm doing wrong?

Thanks in advance.

Walter

share|improve this answer

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.