I am working on file uploader which upload the image when the input is changed my code for the form in html is
Instead of sending the data as multipart/form-data
:
ajax.setRequestHeader("Content-Type", "multipart/form-data");
You should send it as application/json
:
ajax.setRequestHeader("Content-Type", "application/json");
You have to just remove the following line:
ajax.setRequestHeader("Content-Type", "multipart/form-data");