Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > document type - file attribute - pdf upload - transformation problem View modes: 
User avatar
Member
Member
tjadoon-gmail - 8/29/2010 1:48:22 PM
   
document type - file attribute - pdf upload - transformation problem
Pdf upload is working just fine.

When in live mode, i click the link to open the pdf, it is coming up as page not found.

Here is the transformation code:

<a href="<%# Eval("PDFDocument") %>" target="_blank"><%# Eval("LinkText") %></a>

URL:

http://localhost:2743/NrccuaCmsSite/Research-Resources/Post-Secondary-Planning-Survey/28b53389-3927-4288-bc66-bf47b197988d

Error:

Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 8/30/2010 7:24:33 AM
   
RE:document type - file attribute - pdf upload - transformation problem
Hi,

Could you please try to use following transformation code:

<a href="<%# GetFileUrl("PDFDocument") %>" target="_blank"><%# Eval("LinkText") %></a>

This code creates a link to your pdf file, if you used Direct uploader Field type in your document type.

Best regards,
Ivana Tomanickova

User avatar
Member
Member
tjadoon-gmail - 8/30/2010 9:24:06 AM
   
RE:document type - file attribute - pdf upload - transformation problem
Perfect Thanks

User avatar
Member
Member
gavin-wdm.com - 12/6/2010 6:36:33 PM
   
RE:document type - file attribute - pdf upload - transformation problem
Hi Ivana,

What if I've used a Media Selection field to upload my PDF into the Media Library?

How would I get the document link?

Gav.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 12/8/2010 1:06:13 PM
   
RE:document type - file attribute - pdf upload - transformation problem
Hi,

the Media Selector form control stores relative URL path in the database, therefore you can use following code in your transformation to create a link into your pdf file:

<a href="<%# Eval("MediaSelectionField") %>"> pdf</a>

Best regards,
Ivana Tomanickova