Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Determine if document has attachment and the file type in code behind View modes: 
User avatar
Member
Member
gatsby0121 - 4/26/2011 11:13:09 AM
   
Determine if document has attachment and the file type in code behind
Currently I have a repeater with checks if the node has an attachment, and if so it spits out the getattachment reference to that node, otherwise, it spits out a link to the node (one just downloads the file, the other displays the page).

I've had a request though to now add flash and video attachments as well, and stream them on the page. This kind of blows up my whole checking for attachment, since the video is an attachment, it will automatically print out the grab attachment url, which I don't want.

Is there a way in the code behind to see the attachment type for a node field?

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 4/26/2011 2:16:28 PM
   
RE:Determine if document has attachment and the file type in code behind
Hello,

You can check the this KB article on how to retrieve additional information about attachments. That way you can determine what attachment is handled and take action according to this.

Best regards,
Boris Pocatko