Warning: Missing boundary in multipart/form-data POST data in Unknown on line 0

后端 未结 2 1586
盖世英雄少女心
盖世英雄少女心 2021-01-04 13:23

I am working on file uploader which upload the image when the input is changed my code for the form in html is

相关标签:
2条回答
  • 2021-01-04 14:08

    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");
    
    0 讨论(0)
  • 2021-01-04 14:16

    You have to just remove the following line:

    ajax.setRequestHeader("Content-Type", "multipart/form-data");

    0 讨论(0)
提交回复
热议问题