title: Ajax to Curl form submission
body: <p>I have an ajax that submits form data with file to a controller, the controller will send this form data to my api using curl. How can I do that?</p>
  
  <p>I cannot directly submit the form to my api, it have to go through my controller. :(</p>
  
  <p>my ajax</p>
  
  <pre><code>data = new FormData();
          data.append( 'file', $( '#file' )[0].files[0] );
          data.append( 'title', title );
          data.append( 'description', description );
          data.append( 'module_id', module_id );
          data.append( 'tags', tags );
          data.append( 'groups', groups );
          $.ajax({
              url: '/controller/upload',
              data: data,
              processData: false,
              contentType: false,
              type: 'POST',
              success: function ( data ) {
                  window.location.reload();
              }
          });
  </code></pre>
  
  <p>My controller function</p>
  
  <pre><code>public function uploadAction(){
      $response = new \Phalcon\Http\Response();
      $response-&gt;setContentType('application/json', 'UTF-8');
      $response2 = "{}";
      if($this-&gt;request-&gt;getPost()){
          $version = $this-&gt;session-&gt;get("version");
          $data = $this-&gt;request-&gt;getPost('data');
          $response2 = $this-&gt;useCurl("api_link","POST",$data);
      }
      return $response-&gt;setContent($response2);
  }
  </code></pre>