How to save a base64 in a mysql database?

0

I'm creating an application using AngularJS and using webservlets with connection to the mysql database.

To generate the binary, I use the following code:

 $scope.adicionarArquivo = function (element) {
    var reader = new FileReader();
    reader.readAsDataURL(element.files[0]);

    setTimeout(function () {
        $scope.itemSelecionado.arquivo = reader.result;
    }, 1000);

};

The binary is generated correctly and I can display the image in an IMG tag. The problem occurs when I save in the bank. First how should I store this binary in java to pass in mysql? And, what variable do I create in the bank, blob? binary?

    
asked by anonymous 14.10.2018 / 21:55

0 answers