How to send files to the backend


In this codes, “fileuploader” is a form and “attachment” is a simplevault.

My code threw the following error at runtime

Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse () at request.onloadend (app.js:2190:1183)

I am using the Laravel framework for backend development.
I would be grateful if you could help me resolve this issue.

Could you please, provide a complete demo with your backend script for the file uploading.