title: How to upload file using Cakephp 3.0?
body: <p>I am trying to create a file upload on cakephp, I haven't been able to find any decent tutorials for cakephp 3.0 that go in detail, and I don't understand how to install plugins. </p>
  
  <p>I have this in my add section</p>
  
  <pre><code>echo $this-&gt;Form-&gt;create('filename', array('action' =&gt; 'upload', 'type' =&gt; 'file'));
  echo $this-&gt;Form-&gt;file('filename');
  </code></pre>
  
  <p>I haven't added anything in the controller yet</p>
  
  <pre><code>/**
   * Index method
   *
   * @return void
   */
  public function index()
  {
      $this-&gt;paginate = [
          'contain' =&gt; ['Courses']
      ];
      $this-&gt;set('contents', $this-&gt;paginate($this-&gt;Contents));
      $this-&gt;set('_serialize', ['contents']);
  }
  
  /**
   * View method
   *
   * @param string|null $id Content id.
   * @return void
   * @throws \Cake\Network\Exception\NotFoundException When record not found.
   */
  public function view($id = null)
  {
      $content = $this-&gt;Contents-&gt;get($id, [
          'contain' =&gt; ['Courses']
      ]);
      $this-&gt;set('content', $content);
      $this-&gt;set('_serialize', ['content']);
  }
  
  /**
   * Add method
   *
   * @return void Redirects on successful add, renders view otherwise.
   */
  public function add()
  {
      $content = $this-&gt;Contents-&gt;newEntity();
      if ($this-&gt;request-&gt;is('post')) {
          $content = $this-&gt;Contents-&gt;patchEntity($content, $this-&gt;request-&gt;data);
          if ($this-&gt;Contents-&gt;save($content)) {
              $this-&gt;Flash-&gt;success('The content has been saved.');
              return $this-&gt;redirect(['action' =&gt; 'index']);
          } else {
              $this-&gt;Flash-&gt;error('The content could not be saved. Please, try again.');
          }
      }
      $courses = $this-&gt;Contents-&gt;Courses-&gt;find('list', ['limit' =&gt; 200]);
      $this-&gt;set(compact('content', 'courses'));
      $this-&gt;set('_serialize', ['content']);
  }
  
  /**
   * Edit method
   *
   * @param string|null $id Content id.
   * @return void Redirects on successful edit, renders view otherwise.
   * @throws \Cake\Network\Exception\NotFoundException When record not found.
   */
  public function edit($id = null)
  {
      $content = $this-&gt;Contents-&gt;get($id, [
          'contain' =&gt; []
      ]);
      if ($this-&gt;request-&gt;is(['patch', 'post', 'put'])) {
          $content = $this-&gt;Contents-&gt;patchEntity($content, $this-&gt;request-&gt;data);
          if ($this-&gt;Contents-&gt;save($content)) {
              $this-&gt;Flash-&gt;success('The content has been saved.');
              return $this-&gt;redirect(['action' =&gt; 'index']);
          } else {
              $this-&gt;Flash-&gt;error('The content could not be saved. Please, try again.');
          }
      }
      $courses = $this-&gt;Contents-&gt;Courses-&gt;find('list', ['limit' =&gt; 200]);
      $this-&gt;set(compact('content', 'courses'));
      $this-&gt;set('_serialize', ['content']);
  }
  
  /**
   * Delete method
   *
   * @param string|null $id Content id.
   * @return void Redirects to index.
   * @throws \Cake\Network\Exception\NotFoundException When record not found.
   */
  public function delete($id = null)
  {
      $this-&gt;request-&gt;allowMethod(['post', 'delete']);
      $content = $this-&gt;Contents-&gt;get($id);
      if ($this-&gt;Contents-&gt;delete($content)) {
          $this-&gt;Flash-&gt;success('The content has been deleted.');
      } else {
          $this-&gt;Flash-&gt;error('The content could not be deleted. Please, try again.');
      }
      return $this-&gt;redirect(['action' =&gt; 'index']);
  }
  </code></pre>
  
  <p>but after this no idea what to do.</p>