title: Insert pdf as blob and display
body: <p>So I'm getting a Pdf file send to my webservice for me to upload,
  it's send to me as a base64Binary type variable,</p>
  
  <p>and uploaded using below script :</p>
  
  <pre><code>function SaveEIM($parameters)
  {
     mysql_query("INSERT INTO tablename (Filename, FileSize, File) 
                  VALUES ( '" . $parameters['Filename'] . "', '". $parameters['FileSize'] . "', '" . $parameters['File'] . "' ) ") or die (mysql_error());
  }
  </code></pre>
  
  <p>Now everything is getting uploaded, only the weird thing is, for instance if I upload an 370KB file, it's 490KB in the Database....
  I don't know how this happens, and if this is normal?</p>
  
  <p>Now to save it in my fileserver :</p>
  
  <pre><code>$query = mysql_query("SELECT File FROM tablename WHERE ID = '1' ") or die (mysql_error());
  $fetch = mysql_fetch_array($query);
  $data = $fetch[0];
  file_put_contents("user_123.pdf", $data);
  </code></pre>
  
  <p>When I open this file that is getting saved now in my fileserver, I get this error : "user_123.pdf cannot be opened because this filetype is not supported or because it is damaged."</p>
  
  <p>I'm fairly new to Blob types, and I know that storing files on your server is sometimes better, but I have to use Blob times, since I was asked to do so.</p>
  
  <p>If anyone could help me out here, it would be greatly appreciated.</p>