title: CakePHP array to string conversion error when uploading a video through a form to a live server
body: <p>We are trying to upload videos to our site through a form using CakePHP. On a local MAMP server everything works perfectly but on our live server (shared cloud hosting) we get the following error after the form posts:</p>
  
  <blockquote>
    <p>Notice (8): Array to string conversion
    [CORE/Cake/Model/Datasource/DboSource.php, line 1009]</p>
    
    <p>Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Array'
    in 'field list'</p>
  </blockquote>
  
  <p>Instead of inserting the name of the file into the database it tries to insert an array, but only on our live server using the exact same code as out local dev server.</p>
  
  <p>Here is the code for handling retrieval of the filename on post:</p>
  
  <pre><code>        $uploading = false;
  
          if (empty($this-&gt;request-&gt;data['Video']['filepath']['name'])) {
              unset($this-&gt;request-&gt;data['Video']['filepath']);
          }
          else
          {
              $tempFileName = $this-&gt;request-&gt;data['Video']['filepath']['tmp_name'];
  
              if (is_uploaded_file($tempFileName))
              {
                  $uploading = true;
                  $filename = $this-&gt;request-&gt;data['Video']['filepath']['name'];
  
                  $this-&gt;request-&gt;data['Video']['filepath'] = $filename;
              }
          }
  </code></pre>
  
  <p>Any help with this issue would be great, cheers.</p>
  
  <p><strong>EDIT:</strong>
  The code used to insert the data into the database, using the CakePHP save method.</p>
  
  <pre><code>if ($this-&gt;Video-&gt;save($this-&gt;request-&gt;data)) {
      $this-&gt;Session-&gt;setFlash(__('Video added!'));
  
      return $this-&gt;redirect(array('controller'=&gt; 'games', 'action' =&gt; 'gameDetails', $slug));
  }
  </code></pre>