JSFiddle - React, Tailwind, and code Playground

by Brunno Romero

JavaScript

var file = $("#arquivo").prop('files')[0];
var data = new FormData();
data.append('file', file);

$.ajax({
    url: link,
    type: "POST",
    contentType: false,
    data: data,
    processData: false,
    cache: false,
    dataType: "json",
    success: function (data) {
        console.log(data);
    },
    error: function (data) {
        console.log(data);
    }
});