0

This question already has an answer here:

I would like to reproduce the "Save site as template" action with the client object model. Can someone give me a hint how to do this?

marked as duplicate by Atish Dipongkor - MVP, Mike, Eric Alexander Dec 4 '15 at 16:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2

The short answer is "Save site as template" is not possible with the client object model (it IS possible with the server object model).

If you look at the Microsoft.SharePoint.Client.Web class you'll see it doesn't have a SaveAsTemplate method like the server-side SPWeb class does.

Although I'm not familiar with these techniques, this may be a workaround:

http://blogs.msdn.com/b/vesku/archive/2013/08/23/site-provisioning-techniques-and-remote-provisioning-in-sharepoint-2013.aspx

  • Thank you. I guess, there's no way to run code based on the server object model from the client side, even if I am site collection admin? – vilmarci Dec 4 '15 at 14:51
  • 1
    One way you could run server side code from the client side is to develop a web service (server side code required). The web service would call the SPWeb.SaveAsTemplate method and would take in the parameters that the SaveAsTemplate method needs. Or if you're able to develop a server side solution then just create an application page with code behind that calls SaveAsTemplate. If developing server side code/solution isn't an option for you then I'm afraid you're stuck. – Submits Dec 4 '15 at 14:53
  • Sounds bad( No way to save web as template vias JSOM?.. – Gennady G Feb 3 '17 at 17:58

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