What's the recommended location to upload CSS and JavaScript file to SharePoint?



For CSS, the recommended location is The Style Library in the site collection

Note: Use the style library to store style sheets, such as CSS or XSL files. The style sheets in this gallery can be used by this site or any of its sub sites.

By the way, the Style Library has checked in/check out, unlike the Site Asset library.

For Javascript, the Style Library also can be used for this purpose, but it's preferred to put in _layout folder in case you have access to deploy it to the servers.

See more at

| improve this answer | |
  • Thank you, what about SharePoint online? – Sharan Piris Aug 5 '17 at 0:40
  • 1
    Can't deploy files to _layouts in SPO as you have no access to the servers. Use Style Library or Site Assets as appropriate instead. – Greg W Aug 5 '17 at 0:43

The Site Assets folder usually, though they can live in any document library of your choosing.

The Site Assets folder should already have the correct permissions applied.

| improve this answer | |
  • 1
    As M.Qassas has said, his is probably a better solution, and I said Site Assets when I meant style library. :( – Greg W Aug 5 '17 at 0:41

Your Answer

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

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