title: Codeigniter Ajax - Passing Filelist always get NULL
body: <p>i'm trying to upload image to server with ajax and codeigniter php backend, the file select is working </p>
  
  <pre><code>FileList {0: File, length: 1}
  File {name: "21430081_1852077344807727_5107330097727092003_n.jpg", lastModified: 1504942183875, lastModifiedDate: Sat Sep 09 2017 14:29:43 GMT+0700 (WIB), webkitRelativePath: "", size: 25179, …}
  </code></pre>
  
  <p>the file is "not null" but when i send this filelist via ajax to  my controller, the result</p>
  
  <pre><code>{datas: "NULL"}
  datas : "NULL"
  </code></pre>
  
  <p>the controller must return image url in the server (<a href="http://localhost/upload_folder/file.jpg" rel="nofollow noreferrer">http://localhost/upload_folder/file.jpg</a>) </p>
  
  <p>my controller code</p>
  
  <pre><code>class Ajax extends CI_Controller
  {   
      public function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;database();
          $this-&gt;load-&gt;helper(array('form', 'url', 'file'));
          $this-&gt;load-&gt;library(array('upload','user_agent'));
          //error_reporting(E_ALL | E_STRICT);                
      }
  
      public function post_image()
      {
          $this-&gt;upload-&gt;initialize(array(
              "allowed_types" =&gt; "jpg|png|jpeg",
              "upload_path"   =&gt; "./uploads/",
          ));
          $image = $this-&gt;input-&gt;post('image');
          if($this-&gt;upload-&gt;do_upload($image))
         // if(is_object($image))
          {
              $data = $this-&gt;upload-&gt;get_upload_data();
              echo json_encode(['datas' =&gt; base_url().$data[0]['file_name']]);
          }else
          {
              echo json_encode(['datas' =&gt; "error"]);
          }
      }
  
  }
  </code></pre>
  
  <p>My ajax code</p>
  
  <pre><code>function saveToServer(file) {
      var fd = new FormData();
      fd.append('image', file);
      //console.log(fd.get('image'));
      $.ajax({
          url : "&lt;?php echo base_url(); ?&gt;admin/Ajax/post_image",
          type : "POST",
  
          data : {'image' : fd},
          processData: false,
          contentType : false,
          success : function(datas) {
              // do something
              const url = JSON.parse(datas).data;
              insertToEditor(url);
          }
      });
  }
  </code></pre>
  
  <p>i'm retrieve image file using this code</p>
  
  <pre><code>function selectLocalImage() {
      const input = document.createElement('input');
      input.setAttribute('type', 'file');
      input.setAttribute('name', 'image-input')
      input.click();
  
      // Listen upload local image and save to server
      input.onchange = () =&gt; {
          const file = input.files;
  
          // file type is only image.
          //if (/^jpg\//.test(file.type)) {
              saveToServer(file);
              console.log(file);
          //} else {
          //    console.warn('You could only upload images.');
          //}
      };
  }
  </code></pre>