Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Get URL of attached document View modes: 
User avatar
Member
Member
robert-tailor.co - 9/20/2012 10:54:48 PM
   
Get URL of attached document
I've created some documents with file attachments (i.e. images), in a field called "NewsTeaser".

I want to make these attachments available to download (i.e. available at a publicly accessible URL) within a transformation.

I've used:

GetDocumentUrl("NewsTeaser",Eval("NodeAlias"))

and

GetAttachmentUrl("NewsTeaser",Eval("NodeAlias"))

Neither function works. The URLs generated by both seem to require a login to the CMSDesk in order to view them.

Why don't these work? What should I use?

(I can't use GetImageUrl() because I need to add custom class names to the resulting image element).

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 9/25/2012 7:01:45 AM
   
RE:Get URL of attached document
Use the GetFileUrl method. Click the link on the transformation page that takes you to the help document that gives you transformation method examples and search it for GetFileUrl

User avatar
Member
Member
adeluca-ecentricarts - 10/31/2012 10:21:11 AM
   
RE:Get URL of attached document
The documentation for GetFileUrl is unclear. It says it requires an attachment guid object. So I've been passing GetFileUrl(Eval("Image")) which does not work at all. When I just pass it the field name like this GetFileUrl("Image") it works.