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]);

function sendInputData(myData){
        data: myData,
        processData: false,
        contentType : false,
        success: function() {
        error: function() {

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:

public Response inputController(MultivaluedMap<Object, Object> str){
    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)?