List Instance with data RRS feed

  • Question

  • Hello

    I need create a custom list with a feature and I must add an attachment to the list instance.
    I know add "normal" data:
        <Field Name="Title">XXXXXX</Field>
         <Field Name="Value">XXXXXXX</Field>
    But I do not know how add an attachment.


    Wednesday, July 1, 2009 9:05 AM


  • I don't believe this is possible using Data for the ListInstance.  I tried saving a list as a template including data which had a list item with an attachment.  Then downloaded the STP, renamed to a CAB and extracted the manifest.xml.  There wasn't any attributes which stood out and the STP also contained a file called 10000000.000 which I believe was my attachment.  SharePoint is doing something behind the scenes, because of this I think the only approach would be to create the list item programatically using a Feature Receiver and attaching the file.  An example of setting the attachment can be found here

    Hope this helps

    My SharePoint Blog -
    • Marked as answer by Elena B Wednesday, July 1, 2009 2:08 PM
    Wednesday, July 1, 2009 10:53 AM

All replies