Attachments
Dealing with items attachments
Getting attachments
list := sp.Web().GetList("Lists/MyList")
item := list.Items().GetByID(1)
attachments, err := item.Attachments().Get()
if err != nil {
log.Fatal(err)
}
for _, attachment := range attachments.Data() {
data := attachment.Data()
fmt.Printf("%s (%s)\n", data.FileName, data.ServerRelativeURL)
}Items have attachments
Adding attachments
Getting attachment by name
Attachment actions
Last updated
Was this helpful?
