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

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>
| improve this answer | |
  • 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 Nov 18 '16 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. – Prasad Gavande Nov 18 '16 at 9:00
  • also have a look at raviranjank.wordpress.com/2014/06/08/… – Prasad Gavande Nov 18 '16 at 9:13

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.