title: How to save the name of the image from an input file
body: <p>I have a field type <code>string</code> called <code>image_cover</code> on my database.
  I have a field type <code>file</code> on my form:</p>
  
  <pre><code>&lt;?php
    echo $this-&gt;Form-&gt;create($event, ['type' =&gt; 'file'])
      echo $this-&gt;Form-&gt;file('image_cover')
      echo $this-&gt;Form-&gt;submit('Send')
    echo $this-&gt;Form-&gt;end()
  ?&gt;
  </code></pre>
  
  <p>On controller <code>$this-&gt;request-&gt;data('image_cover')</code> is an array with file name, size etc.</p>
  
  <p>I need the value of the <code>image_cover</code> change to only the name of the file.</p>
  
  <p>I'm trying do this on <code>beforeSave</code> but is not working</p>