title: Send API data and image but always empty
body: <p>I'm trying to send a user picture to my api with Slim 3, PHP 7 and JQuery 2.1.1
  But when I call api in HTML page then I get couple errors in Apache log, it seems that data arguments are empty and I dont know why.
  Someone could help?</p>
  <pre><code>-------HTML source code api call
  function savePicture(){
        
    var fID = $('#edtIDUser').val();
    var fPicture = document.getElementById('img').src;
           
    $.ajax({
      type:&quot;POST&quot;,
      cache:false,
      url:&quot;index.php/user_picture/&quot;,
      timeout:3000,
      contentType:&quot;application/json; charset=utf-8&quot;,        
      data:{'id_user': fID, 'picture': fPicture},
      dataType:&quot;text&quot;,
      async:false,
      error: function (request, error) {          
        alert(&quot;error&quot;);
      },
      success: function (result) {
        alert(&quot;ok&quot;);
      }
    });
  
  }
  </code></pre>
  <p>AND API</p>
  <pre><code>----API source code 
      $app-&gt;post('/user_picture/',  function(Request $request, Response $response) {
      
      $params = $request-&gt;getParsedBody();
      
      $iduser = $params['id_user'];
      
      $uploadedFile = $request-&gt;getUploadedFiles();
      $img = $uploadedFile['picture'];    
  
      $data               = file_get_contents($img);
      $escaped            = bin2hex($data);
  
      //TO-DO
  }
  </code></pre>
  <p>Error #1: Trying to access array offset on value of type null in $params['id_user']
  Error #2: Undefined index 'picture'
  Error #3: file_get_contents(): Filename cannot be empty</p>