Posting form data using javascript with Kendo Upload stop working recently

0 Answers 193 Views
Upload
Jimmy
Top achievements
Rank 1
Iron
Veteran
Jimmy asked on 14 Jun 2022, 02:35 AM

Hi

I have upload code similar to the below and was working till recently.

Error preventing the form from being posted. but no error detail from JavaScript.

This only happen using Chrome, file Firefox no issue.

No problem when posting without the rawfile.

Can anyone help?Thanks in advance.

<script>
    $("#submitForm").on("click", function(e) {
        e.preventDefault();
 
        // Append the desired file
        var formData = new FormData();
        var upload = $("#files").getKendoUpload();
        var files = upload.getFiles();
        formData.append('files', files[0].rawFile);
 
        // Send the request
        $.ajax({
            url: 'index.php?type=save',
            type: 'POST',
            data: formData,
            cache: false,
            contentType: false,
            processData: false,
            success: function (response) {
                console.log(response);
            }
        });
    });
</script>

 

Martin
Telerik team
commented on 16 Jun 2022, 05:08 PM

Could you please elaborate what error you are receiving? I tested the provided code in this example and no errors appear.

No answers yet. Maybe you can help?

Tags
Upload
Asked by
Jimmy
Top achievements
Rank 1
Iron
Veteran
Share this question
or