kentico_sandroj
Hi Peter,
As per our conversation, the attachment issue has been resolved. For future reference or for anyone that might be interested, the following code was used:
node.InsertAsNewCultureVersion(CultureCode); // Inserts new culture version (keeps attachment GUID value in the field for the new culture version)
node.SetValue(“Sample”, null); // Clears the attachment GUID from the new culture version – we want to attach brand new attachment with different GUID
DocumentHelper.AddAttachment(node, "Sample", postedFile, tree); // Adds attachment with new GUID and stores GUID to the document field (Without clearing the GUID it uses the one from document field and gets the existing attachment and overrides it with the new binary data)
node.Update(); // Update document to store new field value
Best Regards,
Sandro Jankovic
Hi Peter,
As per our conversation, the attachment issue has been resolved. For future reference or for anyone that might be interested, the following code was used:
node.InsertAsNewCultureVersion(CultureCode); // Inserts new culture version (keeps attachment GUID value in the field for the new culture version)
node.SetValue(“Sample”, null); // Clears the attachment GUID from the new culture version – we want to attach brand new attachment with different GUID
DocumentHelper.AddAttachment(node, "Sample", postedFile, tree); // Adds attachment with new GUID and stores GUID to the document field (Without clearing the GUID it uses the one from document field and gets the existing attachment and overrides it with the new binary data)
node.Update(); // Update document to store new field value
Best Regards,
Sandro Jankovic