File operations using SPServices

Nov 7, 2013 at 10:49 PM
Is there anyway to replicate the file operaations like SPListItem.File.Publish() & SPListItem.File.Unpublish() using SPServices?
Nov 8, 2013 at 1:30 AM
I don't think so. There doesn't seem to be an asmx Web Service which would cover it.

What are you trying to accomplish?

Nov 8, 2013 at 3:11 PM
I have a requirement to publish all the files inside a folder on each selection of a folder from allitems.aspx page.
OOB publishing feature from the "manage content and structure" menu supports bulk publishing of files inside a folder.

Nov 13, 2013 at 8:50 PM
If you're trying to manage files all within the SharePoint site (no fileservers involved), you can use "CopyIntoItemsLocal" to copy files wherever they need to be. See the docs at If you need to move files, you just need to accomplish an UpdateListItems-Delete operation after the copy action.

Nov 15, 2013 at 10:45 AM
Edited Nov 15, 2013 at 11:09 AM
Nov 16, 2013 at 2:30 PM
Edited Nov 17, 2013 at 5:08 AM

You deleted it, but I can see it. ;+)

I never wrapped the PublishingService, did I? Do you have a reason to use it? It doesn't address SPBreed's needs, but it could still be useful.

SPBreed: I wonder if a simple UpdateListItems call would allow you to set the status somehow?

Nov 18, 2013 at 1:07 AM
Hi Marc,

From the SharePoint manager I figured out "vti_level" field holds the value of published status


I tried updating the list item with new value
<script type="text/javascript">
    $(document).ready(function () {
  operation: "UpdateListItems",
  listName: "holderItems",
  ID: 57,
  async: false,
  valuepairs: [["vti_level", "2"]],
  completefunc: function(xData, Status) {    
Still no luck.
<ErrorCode>0x81020014</ErrorCode><ErrorText>One or more field types are not installed properly. Go to the list settings page to delete these fields.</ErrorText>
I tried even with "valuepairs: [["Level", "2"]]" SharePoint is not recognizing the value pairs.