SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am following this link to add some infopath forms into different doc lib when a site is provisioned.

<File Path="Module1\File-01.xml" Url="./SalesLib1/File-01.xml" Type="GhostableInLibrary" /> this gives me an error "the file or folder name sitecoll/subsite/futuresite/. contains invalid characters.

<File Path="Module1\File-01.xml" Url="SalesLib1/File-01.xml" Type="GhostableInLibrary" /> this give me error no url found

share|improve this question

Depending on what else your doing as part of the site definition I'd consider doing this using a web scoped feature and use feature stapling rather than creating a new site definition. It would also be helpful if you could post the Modules element as well from the definition.

Anyway here's an xml snippet of provisioning files from a definition:

<Module Name="SampleForms" Path="Files\SampleForms" Url="SampleFormsLibrary">
    <File Url="SampleForm1.xml" Type="GhostableInLibrary">
        <Property Name="Title" Value="Sample Form 1" />         
        <Property Name="ContentType" Value="SampleForm" />
    <File Url="SampleForm2.xml" Type="GhostableInLibrary">
        <Property Name="Title" Value="Sample Form 2" />         
        <Property Name="ContentType" Value="SampleForm" />

So in the above example the directory structure of the definition would be:


Make sure the Lists element that creates the destination library is above the Modules element within the Configuration section of your onet.xml.

share|improve this answer

Have you considered publishing the form as a farm solution? Then it can be activated at the appropriate level and used within the document library.

share|improve this answer
It's a farm solution. I heard this is a good way to implement. Lists are supposed to be created before module since creation of the list is in onet.xml. I also tried url="/libraryname/filename" but i got the "the url /libraryname is invalid – Julie May 25 '11 at 19:54
So you are trying to implement the sites using a custom site definition? – Lori May 25 '11 at 20:04
Yes, you are correct. – Julie May 25 '11 at 20:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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