You need to sign in to do that
Don't have an account?
Wim Velzeboer 6
File field preview
Hi,
I would like to make a visualforce page with a preview of the file attached to the Knowledge article within a custom file field.
Currently I am able to do that, but only for an chatterFile/Attachment but not a file-field file, with the code below.
But how to I modify my code to preview a file stored within a custom-file-field on a Knowledge Article
<div class="chatterFileViewerPanel" id="chatterFileViewerPanel">
<embed src="/_swf/192001/sfc/flex/DocViewer.swf"
flashvars="shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false"
width="100%" height="100%" align="middle" id="renditionLarge" quality="high" bgcolor="#f3f3f3" name="renditionLarge"
allowscriptaccess="sameDomain" allowfullscreen="true" pluginspage="http://www.adobe.com/go/getflashplayer" wmode="opaque"
type="application/x-shockwave-flash" />
<noembed><p>Flash file preview</p></noembed>
</div>
<script>
insertFlexComponent('/_swf/192001/sfc/flex/DocViewer',
'shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false',
'100%', '100%', '#f3f3f3', 'chatterFileViewerPanel', 'renditionLarge', false,
{ adobeFlashVersionLbl : 'You must enable or download Adobe Flash Player version 9.0.115 or later to use this feature.',
downloadAdobeLbl : 'Download Adobe Flash Player',
downloadAdobeLinkLbl : 'Click the link below to download the Adobe Flash Player:',
closeDialogLbl : 'Cancel'});
Ninja.Flex.ContentStaticResourcesBase = '/_swf/192001/sfc';
Ninja.Flex.ShepherdController = '/sfc/servlet.shepherd';
</script>
I would like to make a visualforce page with a preview of the file attached to the Knowledge article within a custom file field.
Currently I am able to do that, but only for an chatterFile/Attachment but not a file-field file, with the code below.
But how to I modify my code to preview a file stored within a custom-file-field on a Knowledge Article
<div class="chatterFileViewerPanel" id="chatterFileViewerPanel">
<embed src="/_swf/192001/sfc/flex/DocViewer.swf"
flashvars="shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false"
width="100%" height="100%" align="middle" id="renditionLarge" quality="high" bgcolor="#f3f3f3" name="renditionLarge"
allowscriptaccess="sameDomain" allowfullscreen="true" pluginspage="http://www.adobe.com/go/getflashplayer" wmode="opaque"
type="application/x-shockwave-flash" />
<noembed><p>Flash file preview</p></noembed>
</div>
<script>
insertFlexComponent('/_swf/192001/sfc/flex/DocViewer',
'shepherd_prefix=/sfc/servlet.shepherd&v={!myDocument.id}&mode=chatterfilepreview&in_tests=false',
'100%', '100%', '#f3f3f3', 'chatterFileViewerPanel', 'renditionLarge', false,
{ adobeFlashVersionLbl : 'You must enable or download Adobe Flash Player version 9.0.115 or later to use this feature.',
downloadAdobeLbl : 'Download Adobe Flash Player',
downloadAdobeLinkLbl : 'Click the link below to download the Adobe Flash Player:',
closeDialogLbl : 'Cancel'});
Ninja.Flex.ContentStaticResourcesBase = '/_swf/192001/sfc';
Ninja.Flex.ShepherdController = '/sfc/servlet.shepherd';
</script>