Portal Engine
Version 2.x > Portal Engine > attachment in my document View modes: 
User avatar
Member
Member
kogany - 11/28/2006 9:07:19 PM
   
attachment in my document
Hi if i have attachment in my document
how i can get path to attachment on filesystem from this code

If CType(dataObj, CMS.DataEngine.DataClass).ClassName = "Moblin.Phone" Then
Dim cmsDC As CMS.DataEngine.DataClass = CType(dataObj, CMS.DataEngine.DataClass)
WriteTrace("Name=" & cmsDC.DataRow.Item(1))
End If


thanks alex

User avatar
Guest
admin - 12/7/2006 9:14:07 AM
   
Re: attachment in my document
Hello,

you need to get the file GUID first: cmsDC.DataRow("MyFileField")

and the file is stored on the disk (if you configured the files to be stored in the file system) in folder:

<web project>\cmsdesk\<site name>\files\<first two letters of the GUID>\<GUID>.<fileextension>

Best Regards,

User avatar
Member
Member
kogany - 12/11/2006 10:05:02 PM
   
Re: attachment in my document
i see in this column only "00000000-0000-0000-0000-000000000000"
this is bug in CSM ?

User avatar
Member
Member
kogany - 12/11/2006 10:14:41 PM
   
Re: attachment in my document
i use OnAfterInsert

User avatar
Guest
admin - 12/18/2006 10:12:24 AM
   
Re: attachment in my document
I'm sorry, you actually need to handle the OnAfterUpdate method of the TreeNode handler because the document is first inserted and the uploaded attachments are then stored in the database and their GUID is assigned to the TreeNode, after which the TreeNode.Update method is called.

Regards,