hello concern,
i want to add kentico page attachment using field guid in kentico 13 but i am using another project for it can you help me with rest api to insert page attachement. below code i used in same project but i have to do it with rest api
HttpFileCollection oHttpFileCollection = files; HttpPostedFile oHttpPostedFile = oHttpFileCollection[0]; string fileFileName = oHttpFileCollection[0].FileName; if (spage != null) {
DocumentAttachment attachment = new DocumentAttachment(); Guid attachmentGuid = Guid.NewGuid(); // Adds the file as an attachment of the page e9193c3a - f32a - 447c - 905e-ef8e8e603dfe // attachment = DocumentHelper.AddUnsortedAttachment(spage, attachmentGuid, oHttpPostedFile); Guid fieldGuid = Guid.Parse("e9193c3a-f32a-447c-905e-ef8e8e603dfe"); attachment = DocumentHelper.AddGroupedAttachment(spage,attachmentGuid,fieldGuid,oHttpPostedFile); spage.Update(); spage.MoveToPublishedStep(); spage.ClearCache(); spage.CreateNewVersion(); spage.MoveToPublishedStep();
}
Have you checked out the API examples for Attachments?
yes, but i want to use rest api
I didn't see that before. I don't believe Attachments are supposed by the REST API. You might want to read up on the documentation.
Please, sign in to be able to submit a new answer.