Function

$().SPServices

Web Service

Copy

Operation

CopyIntoItemsLocal

Example

Here is an example provided by LeSanglier from the Discussions thread Move/copy item from/to document library.

<script language="javascript" type="text/javascript" src="/HRD/JQuery/jquery-1.3.2.min.js"></script>
<script language="javascript" type="text/javascript" src="/HRD/JQuery/spservices/jquery.SPServices-0.4.7.min.js"></script>
 
<script language="javascript" type="text/javascript" >
 
 function PreSaveAction() {
 	$().SPServices({
		operation: "CopyIntoItemsLocal",
		async: false,
		SourceUrl: "http://philippe-ee2865/personal/administrator/Shared%20Documents/bradpitt_mini.jpg",
		DestinationUrls: ["http://philippe-ee2865/personal/administrator/Personal%20Documents/bradpitt.jpg"], 
		completefunc: function(xData, Status) {
			alert("Status=" + Status + " XML=" + xData.responseXML.xml);		
			}
	});
 
	return true;

}
</script>

Last edited Jan 5, 2010 at 4:00 PM by sympmarc, version 1

Comments

chloraphil Feb 24, 2015 at 2:46 PM 
Works fine for me!

jdhavo Sep 11, 2013 at 2:00 PM 
Does not work. Tried copying documents in same document library with no success. This operation runs to successful completion but does nothing. Should probably remove this post.