DocumentHelper.AddAttachment not working for new node. Works for existing node

Jon Tibbetts asked on October 22, 2014 16:37

So I'm able to insert an attachment to an existing node, but when I am creating a new node and running my addattachment method it breaks. Do I need to save the node first?

Correct Answer

Brenden Kehren answered on October 23, 2014 13:56

An attachment requires a DocumentID, so this means you'd need to perform your insert of the document/node first (or have it from a previously saved document), save that ID to a parameter, then run your attachment insert with that newly created DocumentID.

1 votesVote for this answer Unmark Correct answer

Recent Answers

Jon Tibbetts answered on October 22, 2014 18:00

So the question I'm having. Can an attachment be added to a new node that hasn't been saved yet?

0 votesVote for this answer Mark as a Correct answer

Charles Matvchuk answered on October 22, 2014 18:33 (last edited on October 22, 2014 18:33)

No I do not believe it can be.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.