Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Get list of uploaded files View modes: 
User avatar
Member
Member
robert-tailor.co - 8/8/2012 10:12:35 PM
   
Get list of uploaded files
I created a directory in CMSDesk to contain PDF files ("/Document/Brochures" in the CMSTree).

I've uploaded a few PDF's to the directory.

I've added a "Documents Data Source" and selected the relevant 'Path' value from the CMS Tree. Everything else is left at the default setting.

I've then added a "Basic repeater" and set the Data source name to the Data Source I added above.

I have set the transformation name to use the built in CMS.File.AttachmentList, and set the control to display on the current Document Type. Everything else is left at the default setting.

The rendered page creates a list of links, but the link name (the FileName) is blank. In other words, this:

<%# Eval("FileName",true) %>

keeps returning blank for all files.

Why?

User avatar
Member
Member
robert-tailor.co - 8/8/2012 10:17:28 PM
   
RE:Get list of uploaded files
Additonal info:

The links render the file URL correctly. E.g.:

<a target="_blank" href="/getattachment/00000000-0000-0000-0000-000000000000/MyFile.aspx">

<br /></a><br /><a target="_blank" href="/getattachment/00000000-0000-0000-0000-000000000000/MyFile2.aspx">

<br />

But the links themselves do not work. I get an "Oops! This link appears to be broken." message from Chrome when I open the links in a new tab.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 8/8/2012 10:17:54 PM
   
RE:Get list of uploaded files
In your documents data source, make sure you have the classnames filtered to cms.file.

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 8/8/2012 10:19:07 PM
   
RE:Get list of uploaded files
For cms.file document types, you use GetDocumentUrl() instead of GetFileUrl or Eval("FileName") to get a link to the file.

User avatar
Member
Member
robert-tailor.co - 8/8/2012 10:27:06 PM
   
RE:Get list of uploaded files
Jiveabillion wrote: For cms.file document types, you use GetDocumentUrl() instead of GetFileUrl or Eval("FileName") to get a link to the file.

Great - thanks!