Reg sending a file as input from javascript to controller

Reg sending a file as input from javascript to controller

Hi
 
I have a requirement where I have a popup where in I take an excel file (Test.xlsx) file as input and I need to pass to the server as input for the MCV action method.
 
example: in the below code "str" should be "file" not filepath as string.

$.ajax({

type:

'POST' ,

url:

' @Url.Action( "CreateUsers" ) ' ,

data: {

'file' : str, ID: $( "#Id" ).val() },

success:
function (data) { }
error: {  }
 
now the CreateUsers() MVC action method of a controller have to read the file as input and can manipulate it.
 
Could you please help me as how to pass file as it is as input in Ajax call to the server MVC action method.
 
Thanks in advance.
 
Best Regards,
Usha.