Convert Byte Array into image

Viewed 33

I am told that the uploaded images are stored in database as byte array and I have to call the and convert them back into image format. any type of images can be uploaded: .svg; .jpg; .png etc. the upload and storing works as it should but I cannot display those images. I have this code:

displayAddPerformance.addEventListener('click', function (e) {
        if (e.target.id == 'edit_product_performance') {
            displayedAddPerformance.classList.add('show');
            displayedEditSeasonOptions.classList.remove('show');

            var year = parseInt($("#existing_seasons_input_field").val(), 10);
            var season = $("#existing_seasons_input").val();
            $.ajax({
                async: true,
                url: '@Url.Action("GetAllDocsForSeason", "MaillingOrder")',
                contentType: "application/json; charset=utf-8",
                data: { year: year, season: season },
                type: "GET",
                success: function (val) {
                    for (let [i, elem] of val.Value.entries()) {
                        const test = elem.Inhalt
                        
                        $(`#${i}`).attr('src', test);
                    }
                },
                error: function (req, textStatus, errorThrown) {
                   
                }
            });
        };
    });

It calls the images but I get an error saying: 414 (Request-URI Too Long). what changes should I make to display those images?

0 Answers
Related