tags:

views:

295

answers:

2

Hi all, I'm using OOB functionality to upload files to sharepoint. I'm using <module> tags and feature which wraps all data. (it is described here)

Here is example of module in my elements.xml file:

<Module Name="SampleImages" Url="Style Library/Images/SampleImages" Path="Images" RootWebOnly="TRUE">
 <File IgnoreIfAlreadyExists="TRUE" Name="example.jpg" Url ="example.jpg" Type="GhostableInLibrary" />
</Module>

The only problem is that when I deactivate feature uploaded files are not removed. Currently I use feature receiver which removes theese files, since I wasn't able to find any other solution.

So do I miss something or this is the only way how I can get rid of files uploaded in this manner?

+2  A: 

I believe the way you are doing it is the only way.

savageguy
Thanks, I was pretty sure that it will be the only way :( I just had to ask...
drax
+2  A: 

By default SharePoint doesn't remove any of the provisioned files. If you want to clean things up on deactivation you have to do it manually using a FeatureReceiver.

Waldek Mastykarz - MOSS MVP