title: coldfusion How to save pdf file in database and fetch it in browser
body: <p>Insert to MS-SQL 2008 Database</p>
  
  <pre><code>&lt;cffile action="READBINARY" file="#form.FileContents#" variable="binPDF"&gt;
  &lt;cfquery name="Uploaded" datasource="#cfbasedatasource#"&gt;
  INSERT INTO UploadedFiles
      (
      AccountId,
      Filecontent
      )
  VALUES
      (
      '#UrlAccountId#',
      &lt;cfqueryparam value='#binPDF#' cfsqltype='cf_sql_blob'&gt;
      )
  &lt;/cfquery&gt;
  </code></pre>
  
  <p>=========================
      This is Show from Database to browser:</p>
  
  <pre><code>&lt;cfset binaryData = #cfGetfilecontentquery.Filecontent[1]#&gt;
  &lt;cfheader name="Content-Disposition" value="inline; filename=testDocument.pdf"&gt;
  &lt;cfcontent variable="#binarydata#" type="application/pdf" reset="yes" /&gt;
  </code></pre>
  
  <p>But I can only see in browser "Fail to Load PDF Document"</p>