title: sencha Architect (Touch) - the Store don't read my php file
body: <p>I have problem to read my php file with the Store. I think that the problem is the base64_encode command in php file.
  I Explain it. In my php, I take a path with sql code and after, with this path, I get the real image. After I need to give the results saved in an array, to sencha architect.
  This is php Code:
  <code></p>
  
  <pre><code>require("db.php");
      session_start();
      $filepath='';
      $sql = "SELECT concat('C:/wamp/www/Tecnitalia_Optic/app/webroot/img/',folder) as Path, thumb as FileName FROM frames ";
      $result = array();
      if ($resultdb = $mysqli-&gt;query($sql)) {
      while($record = $resultdb-&gt;fetch_array()) {
          $filepath = $record['Path'];
          $nomeFile = $record['FileName'];
          $mimetype = pathinfo($nomeFile, PATHINFO_EXTENSION);
          $filedata=filesize($filepath."/".$nomeFile);
          header('Content-Type: '.$mimetype);
          header('Content-Disposition: attachment; filename="'.$nomeFile.'"');
          header('Content-Transfer-Encoding: binary');
          header('Content-Length: '.sprintf('%d', $filedata));
          header('Expires: 0');
          //readfile($filepath."/".$nomeFile);
          $recordnew = readfile($filepath."/".$nomeFile);
          $result[] = $recordnew;
      }
      $resultdb-&gt;close();
      }
      //count total records from table for paging
      $sql = "SELECT count(*) as num FROM frames ";
      $total = 0;
      if ($resultdb = $mysqli-&gt;query($sql)) {
      $record = $resultdb-&gt;fetch_assoc();
      $total = $record['num'];
      $resultdb-&gt;close();
      }
      //send back information to sencha architect touch
      echo json_encode(array(
      "success" =&gt; $mysqli-&gt;connect_errno == 0,
      "total" =&gt; $total,
      "data" =&gt; base64_encode($result)
      )); 
      /* close connection */
      $mysqli-&gt;close();
  </code></pre>
  
  <p></code></p>
  
  <p>after that, in SA I have created a model with one field with type auto. After I have created a Json Store link with the model but the store say me this: MyJsonReader unable to read data. Open in Browser: api/frames.php</p>
  
  <p>This is my sencha architect code:</p>
  
  <p>Model and store</p>
  
  <pre><code>Ext.define('ciaopoint2.model.frames', {
      extend: 'Ext.data.Model',
       requires: [
          'Ext.data.Field'
      ],
      config: {
          fields: [
              {
                  name: 'mini',
                  type: 'auto'
              }
          ]
      }
      });
  Ext.define('ciaopoint2.store.Frames', {
  extend: 'Ext.data.Store',
  alias: 'store.frames',
  requires: [
      'ciaopoint2.model.frames',
      'Ext.data.proxy.Ajax',
      'Ext.data.reader.Json'
  ],
  config: {
      autoLoad: true,
      model: 'ciaopoint2.model.frames',
      storeId: 'Frames',
      proxy: {
          type: 'ajax',
          url: 'api/frames.php',
          reader: {
              type: 'json',
              rootProperty: 'data'
          }
      }
  }
  });
  </code></pre>
  
  <p>HI Zoltan Thank you for your reply. Can you explain with an example what do you say? I take off the base64_encode command but after what i can do? Inside Architect Touch or in the php file?</p>