Send file via custom rest

I would like to build a simply model on my page with a few filds (for example just name, descripton, file) and then send it via rest api to the server side.

My javascript code is (I could use jquery as well):

function buildAndSendMyData(){
    var formData = new FormData();
    formData.append('name', 'myName');
    formData.append('description', 'myDescription');
    formData.append('file', document.getElementById("myInputFile").files[0]);
    sendInputData(formData);
}

function sendInputData(myData){
    jQuery.ajax({
        url:'/rest/aotest/1.0/main/inputController',
        type:'POST',
        data: myData,
        processData: false,
        contentType : false,
        success: function() {
            console.log("success");
        },
        error: function() {
            console.log("error");
        }
    

I choose the .txt file in myInputFile field (the name of the file is visible in the input label)

I created the controller with MediaType.APPLICATION_FORM_URLENCODED and MultivaluedMap as parameter:

@POST
@Path("/inputController")
@Consumes({MediaType.APPLICATION_FORM_URLENCODED})
public Response inputController(MultivaluedMap<Object, Object> str){
    this.mainService.getAllSmallObjects();
    return Response.ok().build();
}

but it doesnt work. The method inputController is not executed (the breakpoint is in the first line), there is no error in the log file.

What is the best way to send the file via rest api as the model (there has to be the model because the field is not the only value in body of this POST method, there are more - name, description etc)?