title: Data not passing from controller to model Opencart
body: <p>I am having troubles passing data from the controller to the model in opencart(1.5.3). I have modified the 'add products' form to include a file input field, however, the results I am experiencing, I don't understand, so I'd appreciate any input, or suggestions as to a solution.</p>
  
  <p>When I post the form, the data is sent to the controller, but the controller does not pass it to the model, which stops the final database query from being executed.</p>
  
  <p>Im not sure if this is part of this issue, but in firebug, the post data is defined in the source list, but the field name is not defined in the parts list.</p>
  
  <p>Below is an example of the code. It might be worth mentioning that I am using VQmod to add changes on the fly.</p>
  
  <p>View:</p>
  
  <pre><code>      &lt;table class="form"&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;?php echo $entry_product_pins; ?&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="file" name="product_pins" /&gt;&lt;?php echo $tab_pins_instructions; ?&gt;
        &lt;/td&gt;
          &lt;/tr&gt;
     &lt;/table&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>    if (isset($this-&gt;request-&gt;files['product_pins']['tmp_name'])) {
  
      $this-&gt;data['product_pins'] = file_get_contents($this-&gt;request-&gt;files['product_pins']['tmp_name']); 
  
                      } else {
  
      $this-&gt;data['product_pins'] = '';
  
     }
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>            if ( isset($this-&gt;data['product_pins']) ) {
  
                  foreach (explode(";\n", $this-&gt;data['product_pins']) as $pin) {
  
                  $this-&gt;db-&gt;query("INSERT INTO " . DB_PREFIX . "product_pins SET pin_product_id = '" . (int)$product_id . "', pin_pin_number = '" . $this-&gt;db-&gt;escape($pin) . "'");
                }
  
              } else { 
  
  // added for debugging
  
  exit("product_pins not set"); }
  </code></pre>