1 Reply Latest reply on Jul 20, 2009 8:50 AM by -==cfSearching==-

    Rendering a PDF/Mime Type in cfDIV

    Is this one taken?

      Hi there


      I have a cfform that looks at files in a directory. The template is meant to allow users to select a document and and view it on the page.


      The relevant code is:


      Main Page:

      <cfform name = "name">



      <cfinput name="displayName"  id="displayName" value="#URLEncodedFormat(displayName)#" type="text">




        <cfdiv bind="url:/_admin/utilities/viewer/viewer.cfm?displayName={displayName}" />







      <cfset mimeType = getPageContext().getServletContext().getMimeType(displayName)>


      <cfheader name="Content-Disposition" value="inline; filename=#displayName#">

      <cfcontent type="#mimeType#" file="#displayName#">



      Problem is, the text in the cfDiv appears literally as:



      %PDF-1.4 %äüöß 2 0 obj <> stream x��� 5 }���� ����� ����wVI (���*�T٫��J�&#127;!��W�����u]� � N���J>  �w1������Lek� ���d�\W����dR%3- ��d{@�ȅ��4��G\8!�'��.�� o����� �9ܴ �� ��  �����X�������V����ִ�i>��*Y| �͋�"���=o�� .<��7 ��D�ϸ� uӊ��p�-� m�c ����o�i��j���7$TG�M E P�  P���QB���A 1�` ��; cS! : c2ċ9�c���.(6�Ċ� ΰ���i7



      Is anyone able to make any suggestions?  For instance, can this event be done using AJAX tags?


      Thanks in advance