title: How to write binary data to Cassandra blob - PHP
body: <p>I'm tring to save any files in Cassandra ( CQL3), using YACassandraPDO</p>
  
  <pre><code>enter code here
  
          $tmpName = $_FILES['content']['tmp_name'];
          $fp = fopen($tmpName, 'rb');
          $content = fread($fp, filesize($tmpName));
  
          $stmt = $cass_db-&gt;prepare ("INSERT INTO $table ( id, ctype, fname, content ) VALUES ( now(), :ctype, :fname, textAsBlob('$content')) ;");
          $stmt-&gt;bindValue (':ctype', $_FILES['content']['type']);
          $stmt-&gt;bindValue (':fname', $_FILES['content']['name']);
          $stmt-&gt;execute ();
  </code></pre>
  
  <p>if it's plain/text everything Ok
  But i can't save any binary files,  I tried not to use  textAsBlob, - can't save any types of files
  As a result
  PHP Fatal error:  Uncaught exception 'PDOException' with message 'CQLSTATE[HY000] [2] Input length = 1'</p>