1

We are currently deploying all static files (images, js, css) with a Module project in Visual Studio. So all files will be served like this: /_layouts/files/js/script.js

This seems to work well, but how can a user with correct permissions now delete/create/edit these files? Now we just redeploy the project, but when our application hit prod redeploying will not be as simple, and some of the static files (such as sprites) might be frequently updated.

2 Answers 2

2

If these files will be updated frequently, or updated by end users, then the best place to store them is in SharePoint and not on the file system.

5
  • Can we inject them somehow? We have quite the set of files, and we have a "deployscript" which will deploy all projects and create all lists etc. for first time deploy, can we store them in SharePoint through our deployscript?
    – eirikb
    May 28, 2010 at 9:07
  • You can do whatever you like, have a look at google.co.uk/search?q=use+feature+to+deploy+files+to+sharepoint May 28, 2010 at 11:05
  • So I need to add each file to the XML then? Well, that would work. And links? They will stay the same? (We hard code links in masterpage and some other places)
    – eirikb
    May 28, 2010 at 14:42
  • According to the tag you are using SharePoint-2010. If you are also using VS2010 then I am not sure what the best way is to do this as I am not familiar with the new SharePoint functionalities in VS2010. However, if you are still in VS2008 then you may want to consider using WSPBuilder May 28, 2010 at 17:51
  • I'm using VS2010, and just creating a Module where I append the files. Works great, thanks. The only problem now is how to let my <module> create folders within Style Library
    – eirikb
    Jun 11, 2010 at 12:54
0

You can deploy files either to the layouts folder (as you are doing) In that case only administrators can modify them (and shouldn't, they should be changed by deploying a new solution) or you can deploy them to the SharePoint Virtual File system. In that case you need to make user of modules: http://www.cleverworkarounds.com/2007/10/08/a-simple-example-of-a-sharepoint-%E2%80%9Cfeature%E2%80%9D/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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