Quantcast
Channel: DevNet Questions
Viewing all articles
Browse latest Browse all 8901

AddAttachment Method in Kentico

$
0
0
We are using Kentico v9 and are importing blog posts from Wordpress into Kentico. We are having a problem importing the attachments into the blog post. Here's the code currently being used:var attachmentNode = TreeNode.New(FILE_PAGE_TYPE); attachmentNode.DocumentName = filename; attachmentNode.DocumentCulture = postNode.DocumentCulture; attachmentNode.Insert(postNode); DocumentHelper.AddAttachment(attachmentNode, "ce4c5d10-c143-4ada-9d8a-7e7481b167ef", localFileLocation, postNode.TreeProvider); attachmentNode.Update(); This does not produce any error, and there is a record in the database for the file. However, the file itself is not in Kentico. Does anyone know what I'm doing wrong here?

Viewing all articles
Browse latest Browse all 8901

Trending Articles