Error

[Error] Uncaught TypeError: Failed to execute 'append' on 'FormData': 2 arguments required, but only 1 present.

natrue 2022. 2. 21. 10:31
728x90

원인 : 파라미터가 2개 필요한데 1개를 넣어서..

이말은 즉 이렇게 value값만 넣지말고 

formData.append(value);

key값도 같이 넣어서 보내줘야한다. 

formData.append('key', value);

 

 

참고 : https://stackoverflow.com/questions/41913541/uncaught-typeerror-failed-to-execute-append-on-formdata-2-arguments-requir

 

Uncaught TypeError: Failed to execute 'append' on 'FormData': 2 arguments required, but only 1 present

I am sending the form data to web api controller in asp.net mvc but my ajax request not hitting the controller every time i got the above error kindly tell me how to send request with files in ajax...

stackoverflow.com