title: uploading csv file using jquery ajax and codeigniter
body: <p>here i want upload and move the csv file using jquery ajax function.</p>
  
  <pre><code>$("#file").change(function() { 
    alert($("#file").val());
    $.ajax({
      url: "&lt;?php echo base_url(); ?&gt;index.php/Task_controller/upload_tasksquestion",
      type: "post",
      dataType: 'json',
      processData: false,
      contentType: false,
      data: {file: $("#file").val()},
      success: function(text) {
          alert(text);
          if(text == "success") {
              alert("Your image was uploaded successfully");
          }
      },
      error: function() {
          alert("An error occured, please try again.");         
      }
    });   
  });
  </code></pre>
  
  <p>and my html code is:</p>
  
  <pre><code>&lt; input type="file" class="form-control" id="file" name="file"&gt;
  </code></pre>
  
  <p>and i am testing in controller function uploaded file name
  like $this->input->post('file');</p>
  
  <p>but it is not come to the controller and i want to move that file into a folder.
  please help me where i am doing mistake...</p>
  
  <p>my server side code is:</p>
  
  <pre><code>$curdate=date('Y-m-d');
  $path='./assets/fileuploads/';
  $file=basename($_FILES['file']['name']);
  
  list($txt, $ext) = explode(".", $file);
  $actual_file_name = time().substr($txt, 5).".".$ext;
  if(move_uploaded_file($_FILES['file']['tmp_name'],$path.$actual_file_name))
  </code></pre>