title: PHP base64 encode a pdf file
body: <p>I am using an API where I can send a document to something like dropbox.  According to the documentation, the file which is sent needs to be BASE64 encoded data.</p>
  
  <p>As such, I am trying something like this</p>
  
  <pre><code>$b64Doc = chunk_split(base64_encode($this-&gt;pdfdoc));
  </code></pre>
  
  <p>Where <code>$this-&gt;pdfdoc</code> is the path to my PDF document.</p>
  
  <p>At the moment, the file is being sent over but it seems invalid (displays nothing).</p>
  
  <p>Am I correctly converting my PDF to BASE64 encoded data?</p>
  
  <p>Thanks</p>