1

As we can add list instances in element.xml, is there a way to attach an image in Attachments field?

1

Looks like a no.

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 http://avinashkt.blogspot.com/2009/05/how-to-programmatically-attach-document.html

List Instance with data

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.