I am creating SharePoint hosted app and installed in sub site, Now my requirement is i want to save some document in style library of root site collection How to achieve this?

When I tried to create context like

appWebContext = new SP.ClientContext(appWebUrl);
rootContext = new SP.AppContextSite(appWebContext, rootWebUrl); 

performing some operations on context and while execution console showing error rootContext.load is not a function.

This code isn't working on sub site's app but when I execute code on root site's app then code works perfectly.

  • You need to get the client context for the root site and using same client context upload the file to style library – user27178 Aug 24 '16 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.