0

I am trying to upload an html file to SharePoint. The library exists there. When activating the feature, I am having an error.

This is my module:

 <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Plans" Url="Plans">
    <File Path="Plans\Plan1.html" Url="Plan1.html" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false"/>
    <File Path="Plans\Plan2.html" Url="Plan2.html" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false"/>
  </Module>
</Elements>

The list Plans, already exists on the site. Any idea?

1 Answer 1

1

First make sure url is correct. one more thing, if you define url in module, then you don't need to define in the file So your file will be something link this

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Module Name="Plans" Url="Corect URL ">
    <File Path="Plan1.html" Url="Plan1.html" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false"/>
    <File Path="Plan2.html" Url="Plan2.html" Type="GhostableInLibrary" IgnoreIfAlreadyExists="false"/>
  </Module>
</Elements>
3
  • I am sorry, but that's just wrong. the Path points to the location of file in Visual studio. You can't just remove it. What you're talking about is the URL attribute which is correct in my case, but regarding your code, you changed the Path instead.
    – Jacky
    Commented Nov 18, 2016 at 8:05
  • Hi, I mean if you have given correct url in <Module> attribute then you don't need to give url in <File> attribute again. Commented Nov 18, 2016 at 9:00
  • also have a look at raviranjank.wordpress.com/2014/06/08/… Commented Nov 18, 2016 at 9:13

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.